Closed Bug 2092594 Opened 20 days ago Closed 20 days ago

Don't treat `Connected` -> `Connected` transitions as auth recovery

Categories

(Firefox for iOS :: Firefox Accounts, defect)

Other
iOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bdk, Assigned: bdk)

References

(Blocks 1 open bug)

Details

See https://bugzilla.mozilla.org/show_bug.cgi?id=2084267 for a longer discussion of this. This ticket is for a very specific change:

In FxAccountManager.accountStateSideEffects(), whenever we reach .connected after a .checkAuthorizationStatus event, we consider that auth recovery (https://github.com/mozilla-mobile/firefox-ios/blob/c189b9924791015e2d0b476952fcf8f61f2f789d/MozillaRustComponents/Sources/MozillaRustComponentsWrapper/FxAClient/FxAccountManager.swift#L424-L427)]. However, that means it will trigger for the case where we started in .connected sent the .checkAuthorizationStatus event, but stayed in .connected.

This can trigger infinite loops where we run the ios fxa initialization code, see an auth error, send .checkAuthorizationStatus, stay in .connected but don't fix the underlying auth issue, then retrigger the initialization code. This is especially likely to happen if the checkAuthorizationStatus check is inconclusive. In that case, the a-s state machine stays in the .connected state, since it maybe it happened because of a network error or something.

This change could lead it ios not fetching the profile / device data when it should, but I don't think that's a big deal for 2 reasons:

  • That's what Android does
  • That's what currently happens in the case of a non-auth error when fetching the profile/device info. For example, if the network goes out right after connecting.
Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.