Skip to content

Bun.serve: deliver WebSocket frames coalesced with the upgrade request - #33692

Closed
robobun wants to merge 5 commits into
mainfrom
farm/f5f2b33b/ws-upgrade-coalesced-frames
Closed

robobun wants to merge 5 commits into
mainfrom
farm/f5f2b33b/ws-upgrade-coalesced-frames

Add TLS variant to the coalesced-upgrade test

ed456ed
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 7, 2026 in 15m 30s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/js/bun/websocket/websocket-server-upgrade-coalesced-frames.test.ts:105-117 Test leaks server if connect/secureConnect rejects

Annotations

Check warning on line 117 in test/js/bun/websocket/websocket-server-upgrade-coalesced-frames.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Test leaks server if connect/secureConnect rejects

nit: if this `await` rejects (or `socket.write` throws), `connectRaw()` throws before returning the disposable, so the caller's `using raw = await connectRaw(...)` never runs `[Symbol.dispose]` and the `Bun.serve` server leaks for the rest of the file. Moving lines 104-110 inside the existing `try` block below fixes it. (Implausible in practice — loopback connect to a just-bound port:0 with `rejectUnauthorized: false` — but repo test guidelines want cleanup registered before the first fallible a