Repository navigation
fix(client): honor AbortSignal on in-flight websocket operations - #7440
Solaris-star wants to merge 1 commit into
Conversation
request() already removed an abort listener on teardown, but never registered addEventListener. Wire the signal so abort() cancels the pending batchSend (and subscription cleanup still runs on unsubscribe). Closes #7439 Signed-off-by: Solaris-star <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
π WalkthroughWalkthrough
ChangesWebSocket request cancellation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
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. |
Closes #7439
π― Changes
Bug fix for
wsLink/wsClient.request().AbortSignalwas plumbed intorequest()and teardown already calledsignal?.removeEventListener('abort', abort), but there was no matchingaddEventListener. Aborting the caller's controller therefore never cancelled in-flight WS queries/mutations/subscriptions.This PR:
signalis already aborted β callabort()immediatelysignal.addEventListener('abort', abort, { once: true })β Checklist
(Happy to add a focused unit/integration test for signal abort if maintainers want a preferred harness location.)
Summary by CodeRabbit