Scenario:
user_a.email = 'foo@baa', user_a.fxa_id=1234
user_b.email = 'yo@lo', user_b.fxa_id=None
user_a changes their email address in FxA to 'yo@lo'. FxA allows this because it doesn't know about AMOs users and 'yo@lo' isn't registered to another FxA account.
AMO gets a notification almost straight away via SQS and a task runs to update the user with fxa_id=1234 (user_a) to their new email address. This fails because email is a unique field - it's already used by user_b
- but it's only logged in sentry as an error and can't be fed back to the user via FxA.
user_a tries to log into AMO with their auth'd FxA account. This fails because we do UserProfile.objects.get(Q(fxa_id=identity['uid']) | Q(email=identity['email'])) [src] - i.e. we match on either fxa_id or email and uid=1234 while email='yo@lo'
- matching both
user_a and user_b.
┆Issue is synchronized with this Jira Task
Scenario:
user_a.email = 'foo@baa', user_a.fxa_id=1234user_b.email = 'yo@lo', user_b.fxa_id=Noneuser_achanges their email address in FxA to'yo@lo'. FxA allows this because it doesn't know about AMOs users and'yo@lo'isn't registered to another FxA account.AMO gets a notification almost straight away via SQS and a task runs to update the user with
fxa_id=1234(user_a) to their new email address. This fails becauseemailis a unique field - it's already used byuser_buser_atries to log into AMO with their auth'd FxA account. This fails because we doUserProfile.objects.get(Q(fxa_id=identity['uid']) | Q(email=identity['email']))[src] - i.e. we match on eitherfxa_idoremailanduid=1234whileemail='yo@lo'user_aanduser_b.┆Issue is synchronized with this Jira Task