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

fix: getToken() returns existing promise to a token if one exists instead of a new token. #2648

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

jonathanedey
Copy link
Contributor

@jonathanedey jonathanedey commented Jul 29, 2024

  • Concurrent calls to getToken() don't utilize cache because of a race condition which causes multiple token refreshes.
  • Fixing by returning the existing promise to a token if one is still pending instead of requesting a new one.

Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thanks!

@jonathanedey jonathanedey merged commit 745c22e into master Aug 1, 2024
10 checks passed
@jonathanedey jonathanedey deleted the je-get-token branch August 1, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Optimize Token Retrieval for Messaging#sendEach to Reduce Unnecessary Fetch Requests
2 participants