-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(auth): clean signIn state after all relevant async works finish #14053
refactor(auth): clean signIn state after all relevant async works finish #14053
Conversation
@cshfang @HuiSF @pranavosu Could you help take a look if this PR makes sense? |
Hi @zhouzh1, thanks for the pull request! These changes look reasonable; will review internally with the team and follow up if we need anything else. |
Hey @zhouzh1, are you able to clean up the linting errors so we can get the unit tests running? You should just need to run |
5e01c74
to
0f06e78
Compare
Sample integration test run: https://github.com/aws-amplify/amplify-js/actions/runs/12206362394 |
@jjarvisp I tried the |
@jjarvisp @HuiSF One more question, I am thinking that is the |
Hey @zhouzh1, this is intentional. In the case above, omitting the If you're running into any more challenges, feel free to open an issue and we can discuss there! |
Description of changes
cleanActiveSignInState
method invocations to after thecacheCognitoTokens
method invocations, so that we can ensure the signIn state is only cleaned when all the tasks which're possible to throw error have been successfully finished, otherwise it would cause the relevant APIs isn't able to be retried on errors (e.g. network error).Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.