fxa-client error handling might cause auth errors
Categories
(Application Services :: Fxa Client, defect)
Tracking
(Not tracked)
People
(Reporter: markh, Unassigned)
References
Details
(Whiteboard: [fxsync-])
claude noticed, and I think it's correct. Last 2 aren't exactly error handling, but close.
-
Transient failures drop a still-valid refresh token. For the
Connected
transitionsCheckAuthorizationStatus,CallGetProfile, and
WebChannelPasswordChange,transitions.rsmaps any non-logic error to
S::AuthIssuesvia.to_state_machine_err(|| S::AuthIssues)?. So after network
retries are exhausted, a network outage — or anAuthCircuitBreakerError
(which isFxaError::Other, notAuthentication, so it isn't even the "auth"
case) — lands the user inAuthIssuesandon_auth_issues()deletes the refresh
token even though the server never rejected it. Full re-auth then required. -
Auth circuit breaker + check = forced logout.
check_authorization_status
callsauth_circuit_breaker.check()first (capacity 5, refill 3/min,
oauth.rs:536). Once tripped it returnsAuthCircuitBreakerError; in the
CheckAuthorizationStatusarm that becomesAuthIssues→ token dropped. A tight
loop of auth checks thus self-inflicts a logout. -
Device capabilities silently not re-registered after recovery.
Initialize
fromConnected: ifensure_capabilitieshits an auth error and
check_authorization_statussays "active", we return toConnectedwithout
re-runningensure_capabilities(explicitFIXME, transitions.rs:32, bug
1868418). The device record on the server can be missing capabilities / push
subscription while the client believes it is fully Connected. -
Orphaned device id after
on_auth_issues.on_auth_issueskeeps
current_device_idbut drops the refresh token. The server destroys a device
record when its refresh token dies, so the retained id can be stale until the next
complete_oauth_flowre-registers.
Updated•1 month ago
|
| Reporter | ||
Comment 1•1 hour ago
|
||
Points 1 and 2 are handled by 2060539. We should look at 4 a little more - it's not clear retaining the device ID actually hurts anything. Point 3 does remain though and worth digging in to.
| Reporter | ||
Comment 2•1 hour ago
|
||
Actually looks like (3) was fixed in https://github.com/mozilla/application-services/pull/7457
Description
•