Files
meanaverage b3e449b0f6 fix(ssh): preserve forwarded stream ordering and half-closes (#11876)
* Preserve SSH forwarding write order and half-close semantics

* Subscribe before awaiting TCP fixture connection events

* fix(ssh): leave closing a failed remote-forward channel to the bridge

The remote-forward socket kept its own error handler that called `channel.close()` next to the new
bridge, which already closes the channel when the failed socket closes. Two native closes raced on
one channel and the first one's rejection was not awaited or caught. Keep the warning, drop the
duplicate close. The X11 and local-forward paths only close a channel before a bridge exists, so
they are unchanged.

* test(ssh): wait for stream state instead of sleeping in the bridge tests

The bridge tests asserted in-flight state after fixed 20-30 ms sleeps, which a loaded CI runner can
miss. Wait for the condition instead: the first native write being entered, the next chunk landing
in the paused socket's read-ahead buffer, and output reaching the peer after the channel closed.
What each test proves is unchanged.
2026-11-24 00:44:13 +01:00
..