Skip to content

Reject notification settings without a verified email address - #832

Open
Jack-Edwards wants to merge 1 commit into
stablefrom
feature/notification-channel-guard
Open

Reject notification settings without a verified email address#832
Jack-Edwards wants to merge 1 commit into
stablefrom
feature/notification-channel-guard

Conversation

@Jack-Edwards

Copy link
Copy Markdown
Member

Email is the only way we deliver transfer notifications, but nothing stopped a user without a verified email address from enabling them. The setting saved, read back as enabled, and no notification could ever arrive.

UpdateNotificationSettingsCommand now returns a new MissingNotificationChannel error when a request would enable notifications for a user with no verified email address. Turning notifications off is still allowed in that state, so nobody gets stuck. On the client, the toggles stay disabled until an address is verified.

The component also read RequestedEmailAddress from the contact info changed event where it wanted VerifiedEmailAddress. Both fields carry the same value today, so this changes nothing on its own, but the flag now gates the control and should mean what its name says.

Notes for review:

  • UpdateNotificationSettingsError gains a member, and the endpoint returns 400 for it. Clients switching on that enum will see a value they did not before.
  • Existing rows can still hold an enabled preference for a user with no email address; this guards the way in but does not clean up past data. The enqueue query in Crypter.Core/Features/Transfer/Common.cs checks only the two flags, so those users still get a Hangfire job per received transfer. The job no-ops, and I left it alone as out of scope.

Email is the only delivery channel for transfer notifications, so a user
with no verified email address could enable notifications, see them
persisted as enabled, and never receive anything.

The client now keeps the toggles disabled until an address is verified,
and reads the verified address out of the contact info changed event
rather than the requested one. Those two fields carry the same value
today, so this is not a visible fix on its own, but the flag now means
what its name says before it starts gating the control.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant