Code Monkey home page Code Monkey logo

Comments (12)

vladikoff avatar vladikoff commented on May 31, 2024

cc'ing @mhammond on this as well. Maybe there is something obvious in the log? https://gist.github.com/vladikoff/dd3a1ba2b9394d5b8c3d

from fxa.

rfk avatar rfk commented on May 31, 2024

Full Message: No keyFetchToken

To me, this suggests that we've accidentally refactored something in the content-server, and it's no longer generating the keyFetchToken and including it in the "signed in" message that gets sent to the browser.

from fxa.

jrgm avatar jrgm commented on May 31, 2024

Syncing works for me on stage with Fx42.0 on osx configured to use stage urls.

from fxa.

rfk avatar rfk commented on May 31, 2024

STR for me:

  • FXA_ENV=stage npm start to run a fresh profile against stage
  • Sign up with a new account
  • Open the verification link in the same browser
  • The account gets verified, and the browser transitions to "reconnect to sync state".

On the other hand, this works fine:

  • FXA_ENV=stage npm start to run a fresh profile against stage
  • Sign up with a new account
  • Open the verification link in a different browser
  • The account gets verified and the browser correctly connects to sync

So I suspect some recent refactoring of cross-tab signalling may be the cause of this.

from fxa.

rfk avatar rfk commented on May 31, 2024

Using fxa-local-dev and git bisect, it tells me that this bug was introduced in mozilla/fxa-content-server@ecebd94, corresponding to this PR:

"synchronise signed-in state across tabs"
mozilla/fxa-content-server#3232

Which matches with the fact that it only happens when verifying in the same browser.

from fxa.

jrgm avatar jrgm commented on May 31, 2024

I can reproduce using fxa-local-dev. However, it works fine if I create my own new profile, adjust settings to use stage urls and restart and sign up for a new sync account.

from fxa.

rfk avatar rfk commented on May 31, 2024

As far as I can tell the actual signin is working correctly and a keyFetchToken is being obtained by the browser. Some subsequent message appears to be clobbering the state. Here's an interesting snippet from a failed sync log (with harmless local-in-memory-only tokens etc):

1446774391736   FirefoxAccounts DEBUG   FxAccountsWebChannel message received: {"command":"fxaccounts:login","data":{"email":"[email protected]","lastLogin":1446774379150,"needsOptedInToMarketingEmail":false,"sessionToken":"ac300502042c394244e0e1b5cf72dd4026121cde05c63b31cff3bbe5e296d904","sessionTokenContext":"fx_desktop_v1","uid":"bf15e495f27f45889e61bbb9a14df709","verified":false},"messageId":null}
1446774391737   FirefoxAccounts DEBUG   setSignedInUser - aborting any existing flows
1446774391737   FirefoxAccounts DEBUG   Polling aborted; Another user signing in
1446774391737   FirefoxAccounts TRACE   StorageManager finalizing
1446774391737   FirefoxAccounts INFO    the wait for user verification was stopped: Error: Verification aborted; Another user signing in
1446774391738   FirefoxAccounts INFO    startVerifiedCheck promise was rejected: Error: Verification aborted; Another user signing in
1446774391738   FirefoxAccounts INFO    startVerifiedCheck promise was rejected: Error: Verification aborted; Another user signing in
1446774391738   FirefoxAccounts INFO    startVerifiedCheck promise was rejected: Error: Verification aborted; Another user signing in
1446774391738   Sync.BrowserIDManager   ERROR   Background fetch for key bundle failed: Error: Verification aborted; Another user signing in (resource://gre/modules/FxAccounts.jsm:96:1) JS Stack trace: [email protected]:96:1 < [email protected]:572:12 < [email protected]:483:12 < login/<@FxAccountsWebChannel.jsm:231:14 < [email protected]:934:23 < [email protected]:813:7 < this.PromiseWalker.scheduleWalkerLoop/<@Promise-backend.js:747:1
1446774391738   Sync.BrowserIDManager   ERROR   Could not authenticate: Error: Verification aborted; Another user signing in (resource://gre/modules/FxAccounts.jsm:96:1) JS Stack trace: [email protected]:96:1 < [email protected]:572:12 < [email protected]:483:12 < login/<@FxAccountsWebChannel.jsm:231:14 < [email protected]:934:23 < [email protected]:813:7 < this.PromiseWalker.scheduleWalkerLoop/<@Promise-backend.js:747:1

When I open the verification link in another browser, this "fxaccounts:login" webchannel message is not received and the error does not occur. So I suspect something in the linked commit is either causing this to be sent anew, or sent sooner than it was previously, and is causing FF to abort its keyFetch, clobber its local state, and freak out.

from fxa.

rfk avatar rfk commented on May 31, 2024

So I suspect something in the linked commit is either causing this to be sent anew

Yip:

https://github.com/mozilla/fxa-content-server/pull/3232/files#diff-0dc8124c36f55037d013efdc72d8eaa8R95

The signup-complete page is sending a new "login" message, that goes out over webchannel and causes the browser to reset its state. Commenting out that line resolves this error for me in fxa-local-dev.

from fxa.

mhammond avatar mhammond commented on May 31, 2024

Yeah, desktop really isn't expecting that login message - about:accounts is also doing its own thing to set the logged in state.

I'm 1.2 way through a review of https://bugzilla.mozilla.org/show_bug.cgi?id=1218022, and even though that's only about "choose what to sync", I was 1/2 expecting that patch to cause about:accounts to not handle the login notification and for the server to only send the webchannel login message when context=fx_desktop_v2

from fxa.

mhammond avatar mhammond commented on May 31, 2024

hmm - also, if I'm reading that patch correctly, it looks a little like every tab open to the server might get the message, which would be bad as our singleton module would see all of them. If we do want the client to move to webchannel login messages, we'd only want 1 from that tab that actually did the login.

That might not be the case, but the repeated "startVerifiedCheck promise was rejected" messages in the log above makes me think it might be.

from fxa.

rfk avatar rfk commented on May 31, 2024

I filed mozilla/fxa-content-server#3267 to surface this issue into the content-server repo.

from fxa.

vladikoff avatar vladikoff commented on May 31, 2024

Fixed in https://github.com/mozilla/fxa-content-server/releases/tag/v0.49.3

Thanks for tracking this down Ryan, and thanks Shane and Phil for pushing the fix!

from fxa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.