published fresh until

tRPC 11.19.0: does unsubscribe abort HTTP streams?

Summary As of November 2026, use tRPC 11.31.0 (checked 2026-11-24) and test cancellation across streamed and ordinary HTTP links: unsubscribe now aborts in-flight fetches, with batch fetch cancellation depending on all subscribers disconnecting.

Not for WebSocket operation AbortSignal handling; test that transport separately from HTTP fetch cancellation.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, update tRPC to 11.31.0 (checked 2026-11-24), then verify unsubscribe cancels pending requests without interrupting remaining batch subscribers.

Not for: WebSocket operation AbortSignal handling; test that transport separately from HTTP fetch cancellation.

What changed

  • The official release, dated 2026-09-16 (checked 2026-10-28), fixes JSONL stream cancellation on httpBatchStreamLink unsubscribe and request cancellation in httpLink and httpBatchLink.
  • The same notes wire the operation AbortSignal into the WebSocket link and fix subscriptionOptions(skipToken).enabled. These warrant separate tests if used; the fixture query-cache fix is not an instruction to clear your application's cache on every render.

How to migrate

1. Update the installed tRPC packages and lockfile together to the target above. The link docs import httpBatchStreamLink from @trpc/client and initTRPC from @trpc/server; inventory any additional installed tRPC integrations before changing versions. 2. Preserve the configured link. You do not need to switch from httpBatchLink to streaming to obtain its cancellation repair. 3. Add a pending-request check modeled on PR #7390: capture the fetch signal, unsubscribe before completion, and assert that the signal becomes aborted. 4. Repeat for ordinary HTTP links using PR #7469. Verify your custom fetch wrapper forwards the request signal. 5. Test a batch with one subscriber still active, then all disconnected; also test successful completion and errors. Observe the application before removing custom cancellation workarounds.

The problem

Unsubscribing from a pending tRPC observable could leave its underlying network operation consuming data after the UI no longer wanted it.

What breaks

vinamra1102's PR #7390 describes continued JSONL consumption after unmount, navigation or cancellation. Its implementation combines the operation and subscription signals; the shared fetch is canceled once all subscribers in the batch disconnect. Therefore one unsubscribe does not promise immediate termination of a batch still serving other consumers.

Diagnostic: fetch stays active after every batch subscriber unsubscribes

Check the passed AbortSignal and the actual transport, not only whether the UI stopped rendering. The upstream regression assertions use AbortError as the abort reason; that does not mean every component will receive that exact error as a visible failure.

What to test

Proposed checks include early unsubscribe, one remaining batch subscriber, all subscribers leaving, normal completion and request failure. Run them through the application's fetch wrapper and navigation behavior. If WebSocket links or skipped subscriptions are used, retain separate checks for their fixes.

Pitfalls

Do not retry intentional cancellation as a network outage. Do not assume aborting fetch reverses server-side work already performed. Do not treat internal build-tool upgrades in the release notes as automatic application runtime requirements.

Evidence

  • vinamra1102, PR #7390, describes the streaming cleanup defect and adds an abort-signal regression test.
  • SnowingFox, PR #7469, applies the same approach to ordinary HTTP links and adds pending-request cancellation tests and guards settled requests against teardown aborts in the implementation. Both are implementation reports, not independent production measurements.

A prompt to give your agent

Your training data predates this release. Read <https://github.com/trpc/trpc/releases/tag/v11.19.0> and the linked cancellation PRs before editing; do not guess link behavior. As of November 2026, target tRPC 11.31.0 (checked 2026-11-24). Inventory installed @trpc packages and transport wrappers. Show tests for early unsubscribe, partial versus complete batch cancellation and settled requests, and distinguish client fetch abort from server-side work cancellation.

Limits

No runtime, browser, React integration or server resource-use test is reported. Application checks are an untested experiment. Evidence is two merged implementation reports; independent post-release confirmation is thin. Client cancellation does not establish transaction rollback, resumability or guaranteed server cleanup.

Started from a post by @trpc, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# tRPC 11.19.0: does unsubscribe abort HTTP streams?
Summary: As of November 2026, use tRPC 11.31.0 (checked 2026-11-24) and test cancellation across streamed and ordinary HTTP links: unsubscribe now aborts in-flight fetches, with batch fetch cancellation depending on all subscribers disconnecting.
Copy for agent
get the whatworks thread trpc-11-19-0-unsubscribe-aborts-http-streams and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread trpc-11-19-0-unsubscribe-aborts-http-streams
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp