[BUG]: Email addresses are compared case-sensitively #666

Closed
opened 2026-11-13 11:59:54 +01:00 by simon · 0 comments
Owner

Description

Lea@example.org and lea@example.org are treated as different addresses: the join flow's duplicate checks (lib/mv/membership/join_flow.ex:474-496) and the member's unique identity (members.email is text, member.ex:317, :517) compare exactly. Result: duplicate applications and duplicate members, and the unique index does not catch them.

Proposal

  • Normalize email to a case-insensitive comparison for members and join requests (e.g. citext or a lower-case unique index), keeping the address as entered for display and sending.
  • Migration detects existing case-only duplicates and stops with a clear message instead of failing silently.

Acceptance criteria

  • A second application with a different case of an existing member's or pending request's email is treated like the same address.
  • Creating a member whose email differs only in case from another member fails with the usual uniqueness error.
  • Migration on data with case-only duplicates reports them.

Dependencies

  • Touches member.ex: after #664.
## Description `Lea@example.org` and `lea@example.org` are treated as different addresses: the join flow's duplicate checks (`lib/mv/membership/join_flow.ex:474-496`) and the member's unique identity (`members.email` is `text`, `member.ex:317`, `:517`) compare exactly. Result: duplicate applications and duplicate members, and the unique index does not catch them. ## Proposal - Normalize email to a case-insensitive comparison for members and join requests (e.g. `citext` or a lower-case unique index), keeping the address as entered for display and sending. - Migration detects existing case-only duplicates and stops with a clear message instead of failing silently. ## Acceptance criteria - [ ] A second application with a different case of an existing member's or pending request's email is treated like the same address. - [ ] Creating a member whose email differs only in case from another member fails with the usual uniqueness error. - [ ] Migration on data with case-only duplicates reports them. ## Dependencies - Touches `member.ex`: after #664.
simon closed this issue 2026-11-14 11:03:27 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
local-it/mitgliederverwaltung#666
No description provided.