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
transports: a close that times out must be distinguishable from a confirmed close #774
WsNoiseTransport.close() (packages/cli/src/utils/ws-noise-transport.ts ~:124) and the Noise IK transport's close() (noise-ik-transport.ts ~:163) resolve when the socket's close event fires, and also after a 2 s safety timeout. A close handshake that stalls therefore resolves exactly like a confirmed close. Callers such as the relay's retry path and stop() cannot tell a stalled close from a closed channel, so they report and clean up as if the channel were gone.
What the fix does: a transport close reports whether the close was confirmed. For example, it resolves to a result that distinguishes closed from timed-out, or rejects on the timeout with a named error. Callers that act on a close (the relay's attempt cleanup and stop(), office kill) treat an unconfirmed close as a failure: they report it, keep any record that depends on the channel being gone, and exit non-zero where they already do for other close failures. A real local WebSocket test stalls the peer's close and asserts the unconfirmed result and the caller's failure path.
Related, from the review of #794: a relay channel whose close() never settles leaves stop() waiting without a bound (it awaits the retained channels' close retries). When the transports can report a timed-out close distinctly, bound that wait in stop() too and report the channel as not confirmed closed.
Post-merge audit 2026-11-07 (verified against main 709c161 through the real WS and TCP transports with a peer that never completes the close): the TCP transport (noise-ik-transport.ts) has the same unconfirmed-close behaviour as WebSocket — stop() resolved at the 2 s safety timeout and cleared the host record. The acceptance test for this issue should cover both transports, not only WebSocket.
Activity
tps-flint commentedon Nov 7, 2026
Related, from the review of #794: a relay channel whose
close()never settles leavesstop()waiting without a bound (it awaits the retained channels' close retries). When the transports can report a timed-out close distinctly, bound that wait instop()too and report the channel as not confirmed closed.tps-flint commentedon Nov 7, 2026
Post-merge audit 2026-11-07 (verified against main 709c161 through the real WS and TCP transports with a peer that never completes the close): the TCP transport (
noise-ik-transport.ts) has the same unconfirmed-close behaviour as WebSocket —stop()resolved at the 2 s safety timeout and cleared the host record. The acceptance test for this issue should cover both transports, not only WebSocket.