aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_reconnect_race.py
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/tests/test_reconnect_race.py
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/tests/test_reconnect_race.py')
-rw-r--r--packages/meshbay-hub/tests/test_reconnect_race.py12
1 files changed, 12 insertions, 0 deletions
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