Skip to content

fix(#39): normalise publisher email case to prevent duplicate accounts - #146

Merged
Busiii-adetiba merged 1 commit into
SynapsVault:mainfrom
euniceamoni:fix/39-normalise-publisher-email-case
Oct 20, 2026
Merged

Busiii-adetiba merged 1 commit into
SynapsVault:mainfrom
euniceamoni:fix/39-normalise-publisher-email-case

Conversation

@euniceamoni

Copy link
Copy Markdown
Contributor
  • Trim and lowercase email in publisherRegisterSchema (Zod transform) so the HTTP layer normalises at the boundary before reaching the service.
  • Same trim+lowercase applied in registerPublisher as defence-in-depth for callers that bypass the schema.
  • Migration 0015_lowercase_publisher_email: detects collisions, aborts with an error listing conflicting addresses if any exist, then lowercases all existing rows in-place.
  • New service-level tests cover uppercase, whitespace, combined, already- normalised inputs, and unique-constraint propagation.
  • Two new route-level tests: schema normalises mixed-case input before calling the service; a case-variant duplicate returns 409 CONFLICT. closes Normalise publisher email case so duplicate accounts can't be created #39

…ate accounts

- Trim and lowercase email in publisherRegisterSchema (Zod transform) so
  the HTTP layer normalises at the boundary before reaching the service.
- Same trim+lowercase applied in registerPublisher as defence-in-depth for
  callers that bypass the schema.
- Migration 0015_lowercase_publisher_email: detects collisions, aborts with
  an error listing conflicting addresses if any exist, then lowercases all
  existing rows in-place.
- New service-level tests cover uppercase, whitespace, combined, already-
  normalised inputs, and unique-constraint propagation.
- Two new route-level tests: schema normalises mixed-case input before
  calling the service; a case-variant duplicate returns 409 CONFLICT.
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@euniceamoni Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@euniceamoni is attempting to deploy a commit to the work Team on Vercel.

A member of the Team first needs to authorize it.

@Busiii-adetiba
Busiii-adetiba merged commit ffd28ff into SynapsVault:main Oct 20, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalise publisher email case so duplicate accounts can't be created

2 participants