Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@nitedani is attempting to deploy a commit to the unjs Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
State: draft (the CI run on this branch is the last check before I mark it ready)
On Deno, calling
peer.terminate()crashes the server: the Deno peer callsterminate()on Deno'sWebSocket, which has none, and theTypeErroris uncaught. This PR removes that override, so the Deno peer uses the defaultPeer.terminate(), which callsclose(), as the Cloudflare and SSE peers already do.peer.terminate()mainerror: Uncaught TypeError: this._internal.ws.terminate is not a function, and the Deno process exitsThe line at fault:
src/adapters/deno.ts#L143-L145. The default it now falls back to:src/peer.ts#L172-L175. Deno'sWebSockethas no abrupt close (typeof WebSocket.prototype.terminateis"undefined"on Deno 2.9.8). So the compatibility table now marks Deno'sterminate()with footnote 2, "close()will be used for compatibility". I gave the Cloudflare Durable Objects cell the same footnote, because that peer also falls back toclose().The new shared test, "peer.terminate() closes the connection", checks that the client sees the close and that the server still answers HTTP afterwards. On
mainit fails on Deno withTypeError: fetch failed, because the server process has died. On this branch (fe681d0) it passes on Deno 2.9.8, Bun 1.4.3, Node, uWS (v20.48.0 locally), Vercel and Cloudflare Durable Objects. It skips SSE, becauseEventSourcehas no close event, and Cloudflare without Durable Objects, where locally (wrangler 4.151.1) the client saw no close within 4 s of the server'sclose().