mozilla / fxa

Monorepo for Mozilla Accounts (formerly Firefox Accounts)
https://mozilla.github.io/ecosystem-platform/
Mozilla Public License 2.0
589 stars 212 forks source link

fix(settings): Handle multiple signins to settings #17237

Closed vpomerleau closed 1 month ago

vpomerleau commented 1 month ago

Because

This pull request

Issue that this pull request solves

Closes: #FXA-9984

Checklist

Put an x in the boxes that apply

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Steps to reproduce:

  1. Sign in to two accounts in different tabs. (do not sign out of either)
  2. Add a secondary email to each account.
  3. Sign out of each account and sign back in.

Expected result (with this PR): Secondary email is added to the correct account.

Actual result (without this PR): Both secondary emails added to the same account.

Also recommend testing signing in to one account on the web (directly at localhost:3030) and a different account with sync (requires a cherry-pick of this fxa-dev-launcher PR: https://github.com/mozilla/fxa/pull/17274 to ensure correct behaviour on sign out from sync)

dschom commented 1 month ago

@vpomerleau Haven't tested it yet, just giving it a drive by. Overall this approach seems good to me.

vpomerleau commented 1 month ago

I started looking into creating a functional test for this, but getting the browser context to work correctly with our existing fixtures and tab switching is a bit tricky. Thinking to file a follow-up and pair with @ashrivastava-qa on this. @dschom @vbudhram how would you feel about landing this patch and adding in a functional test later on?

Update: Filed FXA-10226

dschom commented 1 month ago

@vpomerleau I'm fine with doing a separate follow up.