Make sure app has correct SignInType
after upgrading
#930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This avoids scenarios where users migrating from a password
SignInType
to the tokenSIgnInType
can get stuck in a bad state where the app will always fail to retrieve an updated access token because the app still thought the user was using a passwordSignInType
so it would try to use the stored token as a password, which would fail. This causes the app to present notifications saying the user has been signed out, but the app still indicates the user is signed in apart from this error (and all the API calls would fail).This PR essentially has two fixes for this issue...
SignInType
is updated appropriately. Before, theSignInType
would not get updated because when we calledaddAccountExplicitly(...)
the account already existed. In other words, this makes it so that even if a user gets one of these errors, the issue will be resolved when they sign in.SignInType
to beTokens
.This PR also includes some minor improvements to our logging in this area.
Testing Instructions
1. Test that logging in clears the error
7.36
tagrelease/7.37.1
branch, applying this patch to make the issue easy to recreate.2. Test that error is avoided entirely
7.36
tagChecklist