Repository navigation
fix(client): bound stalled token requests with a timeout - #137
Merged
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryBounds both token actions with an eight-second timeout.
No actionable issues were found. No tests were run during this review.
|
nicknisi
approved these changes
Nov 9, 2026
Member
|
THanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #130
A stalled token action keeps the shared refresh promise pending indefinitely, blocking every caller waiting for an access token. Bound both token actions to eight seconds and pass an AbortSignal to cancel the underlying request. The deadline also rejects independently of cancellation, allowing the existing error, retry and finally paths to run even if the action ignores the signal. Clear the deadline whenever the action settles.
Add fake-timer regression coverage for concurrent callers, cancellation, retrying after a timeout, ignoring a late response, and clearing deadlines after success or failure.
Testing and validation
pnpm exec vitest run src/client/tokenStore.spec.ts: 69 pass with the fix; withsrc/client/tokenStore.tsrestored frommain, the 4 new tests fail and the other 65 pass. The full suite (312 tests),oxlint,oxfmt --checkon the touched files,pnpm run build, the example build andpnpm run build:checkall pass on Node 24. The tests mock the server actions, so no real stalled request was exercised; the installed TanStack Start client passessignalthrough tofetch.The eight-second limit is the value from #130 and is a constant, so it is easy to change if you prefer another value or want it configurable.
This change was generated with assistance from Codex (AI).