Parent: #66\nPredecessor: #371\n\nPort the unchanged Bun upstream js/web/fetch/fetch.upgrade.test.ts matrix at contiguous corpus position 4154.\n\nScope:\n- lower and resolve the sibling websocket.helpers module without modifying the copied upstream test\n- support fetch request bodies supplied as async iterables during HTTP Upgrade\n- model Bun.serve server.upgrade request ownership and the 101 Switching Protocols response\n- compute and expose WebSocket upgrade headers, including Sec-WebSocket-Accept\n- decode masked client text and close frames into server websocket callbacks\n- stream server WebSocket frames back through the fetch Response body\n- preserve close ordering and Promise.withResolvers completion\n- provide structured upgrade/protocol errors with operation, phase, cause, and cause-aware stacks\n- add permanent regression coverage and validate the surrounding fetch frontier
Bun parity: port fetch WebSocket upgrade streaming
#372Completed in 898d134 and pushed to main.\n\n- Kept js/web/fetch/fetch.upgrade.test.ts and websocket.helpers.ts byte-for-byte identical to Bun upstream.\n- Lowered the sibling helper import without residual module syntax.\n- Added RFC 6455 frame encoding/decoding with client masking, close frames, extended lengths, incomplete-frame preservation, and server-side unmasked output.\n- Added dynamic Sec-WebSocket-Accept generation from the request key.\n- Added valid Upgrade-only GET request bodies backed by async iterables.\n- Added Bun.serve upgrade validation and a streamed 101 Switching Protocols fetch response.\n- Wired server open, message, close, ping, and pong callbacks in protocol order.\n- Added structured FetchWebSocketUpgradeError failures with code, operation, phase, URL, cause, and a composed cause-aware stack.\n- Added permanent import, codec, handshake, stream, and error-contract coverage.\n\nValidation:\n- exact unchanged upstream file: 1 passed / 0 failed / 0 todo / 0 unsupported\n- positions 4151-4154: 35 passed / 0 failed / 0 todo / 0 unsupported\n- 50-file fetch tail: 1,352 passed / 20 todo / 0 failed / 0 unsupported\n- clean-cache full zig build passed\n- both upstream mirror diffs are clean\n\nParent: #66\nPredecessor: #371
Sign in to comment on this issue.