From 28be8579995aef6df3e87b0f293a4fdd4aa4b072 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 17 Oct 2026 14:32:46 +0200 Subject: 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 --- packages/meshbay-hub/tests/test_reconnect_race.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'packages/meshbay-hub/tests/test_reconnect_race.py') diff --git a/packages/meshbay-hub/tests/test_reconnect_race.py b/packages/meshbay-hub/tests/test_reconnect_race.py index 01c51824..539ae268 100644 --- a/packages/meshbay-hub/tests/test_reconnect_race.py +++ b/packages/meshbay-hub/tests/test_reconnect_race.py @@ -75,6 +75,18 @@ def test_the_replaced_channels_close_event_is_ignored(late): assert out["outcome"] == "done" and out["written"] == 400 +@pytest.mark.parametrize("cfg", [{}, {"rttMs": 800}, {"openMs": 2500}]) +def test_a_film_playing_says_nothing_before_the_handshake(cfg): + # Reported live on a phone moving from mobile data to Wi-Fi: the player + # went on granting stream credit through the reconnect, one grant reached + # the new channel before its handshake, and the node's "Handshake required" + # replaced the film. A grant or a diagnostic for a stream the lost session + # took with it has nowhere to go; the reconnect asks for the stream again. + out = _run(stream=True, runUntil=60000, **cfg) + assert out["outcome"] == "done" and out["reconnected"] == 1 + assert out["refusedTypes"] == [], out["refusedTypes"] + + def _node_opening_types() -> set[str]: """What the node answers before the handshake, read from its dispatch.""" from meshbay_common.protocol import MNP -- cgit v1.2.3