From 2167b7cd7ec006ba3f736bc18970f86f15d88a2a Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 16 Oct 2026 10:41:17 +0200 Subject: fix(spa): a reconnect no longer fails the download it reconnects for While a reconnect ran, every request went out, not only its handshake: a chunk retried between the new channel opening and the proof got "Handshake required", which no retry treats as a dropped connection. Only the opening messages pass now; a replaced channel's late close event is ignored, and a closed channel is retried like a lost one. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/src/meshbay_hub/static/file-utils.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/file-utils.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/file-utils.js b/packages/meshbay-hub/src/meshbay_hub/static/file-utils.js index 585558f..ae6cd6f 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/file-utils.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/file-utils.js @@ -349,9 +349,13 @@ async function _writeOrStall(writable, bytes, at) { } } +// "Transport closed" is not here: that is close(), somebody ending the +// connection on purpose. "DataChannel closed" is the channel going away under +// it, which is what a reconnect is for. function _isRetryableTransportError(err) { return err.name === 'TransportLostError' || err.message === 'Response timeout' + || err.message === 'DataChannel closed' || (err.message || '').startsWith('DataChannel not open'); } -- cgit v1.2.3