You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A net.Socket given to an 'upgrade' listener cannot be written to: socket.write returns undefined #10342
A net.Socket handed to an 'upgrade' listener cannot be written to: socket.write(...) returns undefined and nothing reaches the wire.
The 'upgrade' event itself is correct — it fires, and its arguments (request, socket, head) are right. Only writing back is broken, which makes the event useless for its main purpose: completing a WebSocket or CONNECT handshake by hand.
Cause
The listener receives the socket as an untyped value, so socket.write(...) goes through the composite handle dispatch rather than being statically resolved. net's socket_method_name table has no write row — the method is normally reached through the statically resolved js_ext_net_socket_write3, which a typed receiver picks. With no row, the dynamic path finds nothing and returns undefined instead of throwing, so the failure is silent.
Scope
Reproduced on both transports: the hyper/tokio path on the base commit and the turnloop path. This is pre-existing and not a turnloop regression — found while validating the P5 lane (docs/turnloop/p5-report.md).
Fix shape
Add the missing write row (and audit the rest of that table against the statically resolved entry points — a silent undefined from a missing row is the kind of gap that hides until someone uses the dynamic receiver).
Closing as a duplicate of #10470, which describes the same symptom (socket.write is undefined in an 'upgrade' listener) together with its root cause: Perry completes the WebSocket handshake itself and passes an internal id instead of a net.Socket. The raw-socket half is tracked in #10471.
Activity
TheHypnoo commentedon Sep 28, 2026
Closing as a duplicate of #10470, which describes the same symptom (
socket.writeisundefinedin an'upgrade'listener) together with its root cause: Perry completes the WebSocket handshake itself and passes an internal id instead of anet.Socket. The raw-socket half is tracked in #10471.socket.writeis undefined and nothing the listener writes reaches the client #10470