aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-17 14:32:46 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-17 14:32:46 +0200
commit28be8579995aef6df3e87b0f293a4fdd4aa4b072 (patch)
treea7ce6ea4d5cd8d2a2840496bc8c7017ffc3f7038 /packages/meshbay-hub/src/meshbay_hub/static
parent621305ab0363a43edc62a69664de7254f03514e7 (diff)
downloadmeshbay-28be8579995aef6df3e87b0f293a4fdd4aa4b072.tar.gz
fix(spa): a film playing waits for the session after a reconnect
Stream credit sent before the new handshake was refused, and the node's "Handshake required" replaced the film. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/transport-media.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js b/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js
index ca015b9b..91af0338 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js
@@ -254,7 +254,13 @@ extendTransport(class {
/** Room for `n` more segments. */
grantStreamCredit(n = 1) {
- if (!this._connected) return;
+ // Only on a session that is up: the player goes on granting as it plays
+ // from its buffer through a reconnect, and a grant that reached the new
+ // channel before its handshake was answered "Handshake required", which
+ // the player showed in place of the film. The stream went with the lost
+ // session; the reconnect asks for it again (video-player.js
+ // `reconnectPlan`). The same goes for the diagnostic and the stop below.
+ if (!this._sessionUp) return;
console.log('[stream] grant credit:', n);
this._send({ type: 'stream_more', v: '0.1', n });
}
@@ -267,7 +273,7 @@ extendTransport(class {
* the two halves in one file. The node only logs it.
*/
sendStreamDiag(diag) {
- if (!this._connected) return;
+ if (!this._sessionUp) return;
try { this._send({ type: 'client_diag', v: '0.1', ...diag }); } catch { /* gone */ }
}
@@ -279,7 +285,7 @@ extendTransport(class {
* the next video answered "server busy".
*/
stopStream() {
- if (!this._connected) return;
+ if (!this._sessionUp) return;
try { this._send({ type: 'stream_stop', v: '0.1' }); } catch { /* gone */ }
}
});