Repository navigation
fix(signer): bound unbounded fetch calls with 30s AbortSignal.timeout - #2572
Open
hermiondev wants to merge 1 commit into
Open
hermiondev wants to merge 1 commit into
hermiondev wants to merge 1 commit into
Conversation
BaseSignerClient.request (signer API POST) and createSolanaSponsoredTransaction (fee-payer RPC) call fetch with no timeout or AbortSignal. A stalled api.g.alchemy.com / RPC endpoint leaves these promises pending forever, hanging auth flows and sponsored-transaction construction in the shipped @account-kit/signer@4.88.5 artifact. Both sites now attach AbortSignal.timeout(30000), feature-detected so runtimes without it (older browsers/RN) keep the previous behavior. Reproduced vs a stall server: unfixed shape hangs past 8s watchdog; patched shape rejects TimeoutError at 30s.
hermiondev
requested review from
Richard-Dang,
blakecduncan,
florrdv,
jakehobbs,
niveda-krish and
thebrianchen
as code owners
September 27, 2026 21:38
This branch has not been deployed
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.
Problem
Two production fetch sites in the shipped, actively-released
@account-kit/signer(v4.x.x line, latest publish 4.88.5 on 2026-08-11) have no timeout and noAbortSignal:account-kit/signer/src/client/base.ts—BaseSignerClient.request(): every signer API POST (signup,sign-payload, session/MFA routes) toapi.g.alchemy.comhangs forever if the endpoint accepts the connection but stalls.account-kit/signer/src/utils/solana.ts—createSolanaSponsoredTransaction(): thealchemy_requestFeePayerRPC hangs transaction construction forever on a stalled RPC.This is the same defect class already reported/fixed for the v5 REST client in #2571; the v4 signer surface was missed.
Reproduction
Node 20/24 against a stall server (accept socket, never reply), replicating the exact call shape from the published
dist/esm/client/base.js:845:TimeoutErrorat ~3001ms (3s demo value; PR uses 30s).Fix
Attach
AbortSignal.timeout(30_000)at both sites, feature-detected so runtimes withoutAbortSignal.timeout(older browsers / React Native) keep previous behavior rather than crashing.Validation
tscpackage build (build:esm+build:types): 0 errors on the patched tree (node@20/24, yarn 1.22.22, frozen lockfile).prettier --checkclean after formatting.vitestsuite in this workspace fails identically before and after the change (util.isStringin shared.vitest/setupTests.ts— pre-existing environment breakage, unrelated to this diff; verified viagit stashA/B).Static scan note: my fetch-boundary scanner still flags the
solana.tssite asREVIEWbecause the signal is threaded through the localoptionsobject (config-indirect) rather than inline — the runtime probe above is the ground truth.PR-Codex overview
This PR introduces timeout handling for fetch requests in the
solana.tsandbase.tsfiles, ensuring that stalled requests do not hang indefinitely. It implements a default timeout of 30 seconds for API requests, improving error handling for unresponsive endpoints.Detailed summary
solana.tsto prevent indefinite hanging.SIGNER_REQUEST_TIMEOUT_MSinbase.tsfor default timeout duration (30 seconds).solana.tsandbase.tsusingAbortSignal.timeout.