You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: use exact case-insensitive email comparisons 🐞 #910
Follow-up to the review on #907: updateMemberEmail uses ILIKE for ownership lookup and deletion. It interprets _ and % as wildcards rather than literal email characters.
An admin entering john_doe@example.com can match an existing john.doe@example.com. Reusing that row can save an address different from the one entered. Deleting the previous primary can also match the address being promoted and fail on a database constraint. The member-scoped delete added in #907 prevents deleting other members' rows but does not prevent these matches within the same member.
Steps to Reproduce
Use test members to exercise these cases:
Give a member the secondary address john.doe@example.com, then submit john_doe@example.com through Admin → Update Email. The lookup can select the dot address instead of treating the underscore literally.
Give a member primary john_doe@example.com and secondary john.doe@example.com, then promote the dot address. Deleting the old primary can match both addresses.
Expected Behavior
Compare email addresses exactly, ignoring case, without interpreting wildcard characters. Only the requested address should become primary, and only the previous primary should be deleted.
Acceptance Criteria
Replace pattern matching in the ownership lookup and previous-primary deletion with exact, case-insensitive comparisons.
Preserve member ownership checks, stored spelling, and the member-scoped delete.
Verify _ and % are treated literally, case-insensitive matches still work, and promoting a secondary address does not delete it.
Activity