Skip to content

fix: eliminate token refresh race condition with shared promise - #5

Merged
Senthil455 merged 1 commit into
mainfrom
fix/token-refresh-race-condition
Jun 15, 2026
Merged

fix: eliminate token refresh race condition with shared promise#5
Senthil455 merged 1 commit into
mainfrom
fix/token-refresh-race-condition

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Replace the module-level refreshing boolean + queue array with a single shared Promise. The promise is set synchronously so there is no window between checking and setting where concurrent requests can each trigger their own refresh call. Subsequent requests simply await the same promise instead of being queued.

Replace the module-level refreshing boolean + queue array with a
single shared Promise. The promise is set synchronously so there is
no window between checking and setting where concurrent requests
can each trigger their own refresh call. Subsequent requests simply
await the same promise instead of being queued.
@Senthil455
Senthil455 merged commit bc8a255 into main Jun 15, 2026
2 of 9 checks passed
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.

1 participant