Open Bug 1916747 Opened 2 months ago

Checking for pending commands might fail if you logout soon after startup

Categories

(Firefox :: Firefox Accounts, defect, P2)

defect

Tracking

()

People

(Reporter: markh, Unassigned)

References

(Blocks 1 open bug)

Details

In my STR:

  • Sign in
  • Fairly quickly after sign out.

Observe the console:

1725460290393   FirefoxAccounts DEBUG   Notifying observers of testhelper-fxa-signout-complete
1725460293042   FirefoxAccounts INFO    checking if the command queue is empty now we are idle
1725460293045   FirefoxAccounts TRACE   flushQueue total queued items: 0
1725460293046   FirefoxAccounts ERROR   Checking for pending tab commands after first tab sync failed: TypeError: can't access property "length", recentDevices is null(resource://gre/modules/FxAccountsCommands.sys.mjs:753:9) JS Stack trace: #flushQueue@FxAccountsCommands.sys.mjs:753:9
async*flushQueue@FxAccountsCommands.sys.mjs:725:49
idleObserver@FxAccountsCommands.sys.mjs:701:12
87172> 1725460411359    FirefoxAccounts ERROR   FxA rejecting with error NO_ACCOUNT, details: undefined

That block should check we have a user signed in. Even better though, it would probably expand that "withCurrentAccountState" so the state is obtained when we set the observer and is still alive as it fires. This will help protect the unlikely but possible scenario of an entirely different user being signed in.

(I don't think anything bad happened in this scenario, but we should still gracefully handle it)

You need to log in before you can comment on or make changes to this bug.