Description
A workflow involving changes to primary and secondary emails in a Mozilla Account can lead to duplicate records in CTMS. This creates inconsistencies in how user data and subscriptions are represented.
Steps to Reproduce
- Create a Mozilla Account using an email address
userA@example.com.
- This creates CTMS user 1 with
emails.primary_email and fxa.primary_email set to userA@example.com.
- Add a second email address
userB@example.com as a secondary email but do not make it the primary email.
- In CTMS, this is not recorded. It's only an FxA change at this point.
- Use the secondary email address
userB@example.com to sign up for a newsletter on the website.
- This creates CMTS user 2 with
emails.primary_email set to userB@example.com.
- Go back to the Mozilla Account and make the secondary email
userB@example.com the primary email.
- For CTMS user 1 this updates
fxa.primary_email to userB@example.com while keeping the emails.primary_email value of userA@example.com.
- CTMS user 1's
fxa.primary_email now conflicts with CTMS user 2's emails.primary_email.
Observed Behavior
- Two CTMS records are created:
- CTMS user 1 with:
emails.primary_email: userA@example.com
fxa.primary_email: userB@example.com
- CTMS user 2 with:
emails.primary_email: userB@example.com.
Steps to Reproduce - Alternate workflow
- Create a Mozilla Account using an email address
userA@example.com.
- This creates CTMS user 1 with
emails.primary_email and fxa.primary_email set to userA@example.com.
- Add a second email address
userB@example.com as a secondary email and make it the primary email.
- In CTMS this updates
fxa.primary_email to userB@example.com.
- Use the email address
userB@example.com to sign up for a newsletter on the website.
- This creates CMTS user 2 with
emails.primary_email set to userB@example.com.
Observed Behavior
- Two CTMS records are created:
- CTMS user 1 with:
emails.primary_email: userA@example.com
fxa.primary_email: userB@example.com
- CTMS user 2 with:
emails.primary_email: userB@example.com.
Expected Behavior
- There should be only one CTMS record for the user:
- To fix this issue, define and implement a solution to merge 2 contacts.
Additional Considerations
- The
emails table includes a basket_token, which allows users to navigate to the preference center.
- If records are merged, take into consideration which
basket_token remains functional so users can access the preference center.
- Perhaps a system notification email is sent notifying the user of the merge and providing the chosen basket token as a reference. The other basket token will result in a 404 from that point forward.
Description
A workflow involving changes to primary and secondary emails in a Mozilla Account can lead to duplicate records in CTMS. This creates inconsistencies in how user data and subscriptions are represented.
Steps to Reproduce
userA@example.com.emails.primary_emailandfxa.primary_emailset touserA@example.com.userB@example.comas a secondary email but do not make it the primary email.userB@example.comto sign up for a newsletter on the website.emails.primary_emailset touserB@example.com.userB@example.comthe primary email.fxa.primary_emailtouserB@example.comwhile keeping theemails.primary_emailvalue ofuserA@example.com.fxa.primary_emailnow conflicts with CTMS user 2'semails.primary_email.Observed Behavior
emails.primary_email:userA@example.comfxa.primary_email:userB@example.comemails.primary_email:userB@example.com.Steps to Reproduce - Alternate workflow
userA@example.com.emails.primary_emailandfxa.primary_emailset touserA@example.com.userB@example.comas a secondary email and make it the primary email.fxa.primary_emailtouserB@example.com.userB@example.comto sign up for a newsletter on the website.emails.primary_emailset touserB@example.com.Observed Behavior
emails.primary_email:userA@example.comfxa.primary_email:userB@example.comemails.primary_email:userB@example.com.Expected Behavior
Additional Considerations
emailstable includes abasket_token, which allows users to navigate to the preference center.basket_tokenremains functional so users can access the preference center.