Skip to content

Fix cross-tab race condition in silent SIWE refresh-token rotation - #370

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
NkechiOgbuji:fix/cross-tab-siwe-refresh-race
Jul 29, 2026
Merged

Fix cross-tab race condition in silent SIWE refresh-token rotation#370
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
NkechiOgbuji:fix/cross-tab-siwe-refresh-race

Conversation

@NkechiOgbuji

Copy link
Copy Markdown
Contributor

Close #305

Description

What changed

  • Added a cross-tab refresh coordination layer to ensure only one browser tab performs a silent SIWE refresh at a time.
  • Preserved the existing single-tab behavior while gracefully falling back when cross-tab coordination APIs are unavailable.
  • Added timeout handling so waiting tabs can recover if the coordinating tab exits unexpectedly.
  • Updated the refresh token contract documentation to describe the new coordination mechanism.
  • Added unit tests for the coordination logic and extended the SIWE flow tests to verify only a single refresh request is issued during concurrent refresh attempts.

Verification

  • npm test
  • npm run typecheck
  • npm run lint

@Lakes41
Lakes41 merged commit 871078a into Adamantine-guild:main Jul 29, 2026
1 check 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.

Fix cross-tab race condition in silent SIWE refresh-token rotation

2 participants