Skip to content

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