Skip to content

http_jsc: narrow unsafe surface of WebSocketUpgradeClient::connect

e1a5778
Select commit
Loading
Failed to load commit list.
Closed

http_jsc: narrow unsafe surface of WebSocketUpgradeClient::connect #30785

http_jsc: narrow unsafe surface of WebSocketUpgradeClient::connect
e1a5778
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 22, 2026 in 13m 58s

Code review found 1 potential issue

Found 2 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/web/websocket/websocket-custom-headers.test.ts:407-411 New WebSocket tests don't track ws in clients[] for afterEach cleanup

Annotations

Check warning on line 411 in test/js/web/websocket/websocket-custom-headers.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

New WebSocket tests don't track ws in clients[] for afterEach cleanup

The new `openAndEchoHeaders` helper creates a `WebSocket` without pushing it to the module-level `clients[]` array, unlike every other test in this file. If `Promise.all([opened, headersSeen])` rejects via `ws.onerror`, `ws.close()` is skipped and `afterEach` won't terminate the socket — add `clients.push(ws);` right after construction to match the file's established cleanup pattern (test/CLAUDE.md: "Track resources (servers, clients) in arrays for cleanup in afterEach()").