fix(server): clean up custom route streams on disconnect#16335
fix(server): clean up custom route streams on disconnect#16335mbenhamd wants to merge 12 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
🦋 Changeset detectedLatest commit: 9ef054b The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5348c73 to
2bd6bf0
Compare
2bd6bf0 to
9b12011
Compare
Use the shared custom route bridge to propagate request abort signals into route handlers and pipe streamed Response bodies through Node pipeline for backpressure and cancellation. Cover disconnect cleanup and normal POST completion across Fastify, Express, Koa, and Hono, and document how to forward c.req.raw.signal from custom streaming routes.
9b12011 to
2fe0a96
Compare
Ensure local-registry E2E fixture installs and nested package-manager calls inherit minimum-release-age=0 so freshly published snapshot packages can resolve during CI.
Use an OS-assigned port for the notification resource test and make teardown tolerate setup failures. This avoids CI flakes when the random port collides with another listener.
What changed
Custom API routes now receive the request abort signal, and Node-based adapters pipe streamed Response bodies through the shared server bridge with backpressure-aware cancellation. Fastify, Express, and Koa now stop reading custom route streams when the client disconnects, while Hono forwards the host runtime's request signal into custom route handlers.
This follows up on #16307 after the built-in Fastify stream cleanup in #16308. It keeps MCP and Bun-specific completed-body behavior out of this PR.
Why
The custom route bridge previously read Web Response.body chunks manually and wrote them to Node responses without backpressure or disconnect cleanup. Long-running custom route streams could keep producing after the client closed the connection.
Validation