Last 12 weeks ยท 9 commits
4 of 6 standards met
Bug and both pass directly to the underlying request without creating an internal , and their observable cleanup functions are . This means when a subscriber unsubscribes, the in-flight fetch request is not cancelled โ the same class of bug that was fixed in by PR #7390. Every other link in the package (, , ) already owns its own and calls in the observable cleanup. Fix httpLink โ create an , pass to the requester, call in cleanup. httpBatchLink โ create an , combine it with via so the batch request is aborted when the individual observable unsubscribes, call in cleanup. Pattern matches the existing correct implementations in and . Closes #7468 Summary by CodeRabbit Bug Fixes** Improved cancellation of in-flight HTTP requests when an operation is unsubscribed. Added reliable cancellation for batched HTTP loads during teardown. Ensured request cancellation signals correctly combine operation and subscription lifecycle events.
Bug in had an inverted condition that only threw for , silently accepting booleans, arrays, and objects as valid request IDs. The broken condition: Since is always true when is evaluated, this simplifies to โ it only throws for . Fix This correctly throws when is not , not a , and not a non-NaN . Closes #7450 Summary by CodeRabbit Refactor** Simplified internal request ID validation while preserving existing behavior.
Problem / in capture a pre-existing native / method off the wrapped object and later invoke it detached from its receiver: On runtimes that natively implement the TC39 Explicit Resource Management proposal on generators/async generators โ Bun (JSC) and Node 24+/25 (V8) โ the native / method relies on internally. Calling it detached throws: Bun: at Node 24+/25: This surfaces in practice whenever a tRPC subscription implemented as an async generator (e.g. one built with over ) is torn down โ for example on client disconnect/logout โ since the subscription handler's async generator already has a native , and wraps it to also abort the underlying stream. Confirmed via that this is still present in the latest published version. Fix Call the existing method bound to instead of detached: This preserves the original receiver so the native implementation can use as it expects, while still chaining to the outer cleanup. Testing Added with 3 regression tests: preserves when chaining to a pre-existing preserves when chaining to a pre-existing disposal does not throw for a real async generator with a native , and its block still runs Verified the tests fail (reproducing the exact reported error) with the fix reverted, and pass with it applied. Summary by CodeRabbit Bug Fixes Improved cleanup of synchronous and asynchronous resources by preserving the resource context during disposal. Ensured asynchronous generator cleanup completes reliably without errors. Tests Added coverage for disposal chaining and generator cleanup behavior.
Repository: trpc/trpc. Description: ๐งโโ๏ธ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. Stars: 40582, Forks: 1660. Primary language: TypeScript. Languages: TypeScript (84.3%), MDX (14.2%), JavaScript (0.8%), CSS (0.7%). License: MIT. Homepage: https://tRPC.io Topics: api, next, nextjs, prisma, react, typescript. Latest release: v11.18.0 (2mo ago). Open PRs: 100, open issues: 176. Last activity: 2d ago. Community health: 87%. Top contributors: KATT, dependabot[bot], renovate[bot], juliusmarminge, allcontributors[bot], Nick-Lucas, ixahmedxi, sachinraja, kamilogorek, github-actions[bot] and others.