Skip to content
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

MLIBZ-2585: Queue requests when in the middle of refreshing a MIC access token #321

Merged
merged 9 commits into from
Jul 9, 2018

Conversation

thomasconner
Copy link
Contributor

Description

A response to an API request can result in a 401 which will attempt to refresh a MIC access token. When multiple requests are made in parallel this would cause multiple attempts to refresh the MIC access token. This caused an invalid state that was unrecoverable.

This PR only allows one attempt to refresh a MIC access token while queuing up any other API request made while the refresh attempt is made. Once the refresh attempt completes then the queued requests will be retried.

Changes

  • Queue up pending API requests when refreshing a MIC access token

@thomasconner thomasconner self-assigned this Jul 6, 2018
@thomasconner thomasconner changed the base branch from MLIBZ-2580 to master July 9, 2018 11:51
return null;
})
.then(() => DataStore.clearCache({ client: this.client }))
.catch((error) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the clearCache call also clear the sync queue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it will.

vinaygahlawat
vinaygahlawat previously approved these changes Jul 9, 2018
@thomasconner thomasconner merged commit 9f23613 into master Jul 9, 2018
@thomasconner thomasconner deleted the MLIBZ-2585 branch July 9, 2018 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants