Repository navigation
fix(client): release completed HTTP request abort listeners - #7606
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
I fixed the setup-throw path by calling |
9b7d03e to
f173326
Compare
|
@KATT is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: alexander <[email protected]>
Co-authored-by: alexander <[email protected]>
ed4d631 to
2b929aa
Compare
KATT
left a comment
There was a problem hiding this comment.
π€ Thanks @brennanbutler01! I rebased this, dropped an unrelated lockfile change, and gave the link tests readable names. LGTM: finished requests now remove their abort listeners from a reused signal, and cancellation works as before. The tests fail without the fix.
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |

π― Changes
Reusing an AbortSignal for completed
httpLinkorhttpBatchLinkrequests leaves an additional abort listener on the caller's signal after each request. Five sequential requests leave five listeners, even when the injected fetch implementation registers none. The same happens when a request fails.Add explicit cleanup to the internal signal race helper and call it from link teardown. Cleanup releases input listeners without aborting an already consumed response. When one input aborts, remove the listeners from the other inputs too. Existing callers of
raceAbortSignalskeep its AbortSignal return type.This follows the unsubscribe-cancellation changes in #7469; it preserves their behavior and handles listener lifetime after completion. It does not change batch cancellation into cancellation on the first aborted operation.
Verification
links.test.ts,splitLink.test.ts,createChain.test.ts, anddedupeLink.test.ts.8b649ad874a8fe97c73962d4617912231b975736), 11 of the 16 new link cases fail; the five cancellation/response controls pass. All 16 pass with the fix.Local validation used isolated tooling (Vitest 4.1.10, upstream source aliases and snapshot settings, jsdom for existing tests and Node for listener inspection). A 15-specifier lockfile sync aligns the workspace references with the v11.22.1 release on main; no new dependencies were added. GitHub CI passed build, typecheck, unit and integration tests, all end-to-end jobs, lint, declaration-file consumer tests, and CodeQL on the current head. Current workflow results. Four Vercel preview checks remain red:
next-prisma-websockets-starterandnext-sse-chatrequire tRPC team authorization, whileexamples-todomvcandnext-prisma-starterdeployments failed.Prepared with assistance from OpenAI Codex; focused validation ran locally and the current full suite ran in GitHub Actions.
β Checklist
Summary by CodeRabbit