Skip to content

Fix duplicate logging for successful email confirmation#11466

Merged
aduth merged 6 commits intomainfrom
aduth-duplicate-email-confirmation-log
Nov 7, 2024
Merged

Fix duplicate logging for successful email confirmation#11466
aduth merged 6 commits intomainfrom
aduth-duplicate-email-confirmation-log

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Nov 7, 2024

🛠 Summary of changes

Fixes an issue where we currently log the 'User Registration: Email Confirmation' event twice for every account registration.

Email confirmation happens across two controllers, which each individually validate the incoming confirmation token. Since the analytics were logged as part of this shared validation, it was being logged twice.

The solution is to move the analytics logging to happen only after the first successful validation.

📜 Testing Plan

Verify you see a single 'User Registration: Email Confirmation' event when confirming an email address for a new account:

  1. Run make watch_events in a separate terminal process
  2. Go to http://localhost:3000
  3. Click "Create an account"
  4. Enter an email address
  5. Confirm Rules of Use
  6. Click "Submit"
  7. In the email received, click "Confirm email address"
  8. Observe in make watch_events process output that there is only a single event for 'User Registration: Email Confirmation'

@aduth aduth marked this pull request as ready for review November 7, 2024 15:26
@aduth aduth merged commit bc71607 into main Nov 7, 2024
@aduth aduth deleted the aduth-duplicate-email-confirmation-log branch November 7, 2024 18:36
@aduth aduth mentioned this pull request Nov 12, 2024
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.

2 participants