Commit f1753c33 authored by Grisha Kruglov's avatar Grisha Kruglov
Browse files

Part 3: Don't progress past authentication problems during account restoration

If we don't do this, we end up calling onAuthenticated _after_ callin onAuthenticationProblems.

This isn't a very principled solution, since other similar situations aren't covered.
And, we may fail 'ensureCapabilities' for reasons other than authentication (e.g. network failures).

Arguably, stopping here _is_ better than progressing with an uncertain state.
parent 8bd98b5f
...@@ -683,14 +683,13 @@ open class FxaAccountManager( ...@@ -683,14 +683,13 @@ open class FxaAccountManager(
// If this is the first time ensuring our capabilities, // If this is the first time ensuring our capabilities,
logger.info("Ensuring device capabilities...") logger.info("Ensuring device capabilities...")
if (account.deviceConstellation().ensureCapabilitiesAsync(deviceConfig.capabilities).await()) { if (account.deviceConstellation().ensureCapabilitiesAsync(deviceConfig.capabilities).await()) {
logger.info("Successfully ensured device capabilities.") logger.info("Successfully ensured device capabilities. Continuing...")
postAuthenticated(AuthType.Existing)
Event.FetchProfile
} else { } else {
logger.warn("Failed to ensure device capabilities.") logger.warn("Failed to ensure device capabilities. Stopping.")
null
} }
postAuthenticated(AuthType.Existing)
Event.FetchProfile
} }
Event.SignedInShareableAccount -> { Event.SignedInShareableAccount -> {
// Note that we are not registering an account persistence callback here like // Note that we are not registering an account persistence callback here like
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment