aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_task_lifetime.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-07 17:45:54 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-07 17:45:54 +0200
commit77dd077491aea50e71e21e0d17555a2f91cf818b (patch)
tree87b88674b3210541f413b4992750dcb2807b8f12 /packages/meshbay-node/tests/test_task_lifetime.py
parentd1f998b42137465b610667439527917a00030b4d (diff)
downloadmeshbay-77dd077491aea50e71e21e0d17555a2f91cf818b.tar.gz
refactor(mnp)!: remove stream_seg, the last unencrypted content message
`stream_seg` answered with an MPEG-TS segment as base64 with no encryption at all — the one message on the content plane that never went through a GEK-derived key. Live on both transports, answering any authenticated member. It predates `stream_data`, which does the same job properly (`chunk_ciphertext`, keyed per segment, AES-256-GCM) and has since Phase 12. Its only browser caller, `fetchStreamSegment`, was defined and never once invoked — a plaintext media endpoint with no client. Removed rather than repaired. Gone with it: `_extract_segment` and the ffmpeg semaphore in quic_server, the `fetch_stream_segment` QUIC client method, and `_b64decode` in transport.js, which had no other caller. The H6 regression test lived on this handler — it pinned `_do_stream_segment_async` to a coroutine so `subprocess.run` could not stall the event loop for thirty seconds per request. It is replaced by the property that outlives the handler: no transport carries media outside an AEAD, asserted on `stream_seg` and `data_b64` across all three transport modules. The half of H6 that survives — the live streaming path still spawns ffmpeg — keeps its own test. BREAKING CHANGE: `stream_seg` is no longer answered on either transport. No shipping client sends it. Recorded as part of MNP 2.0, whose other half — the sealed upload — carries the version bump. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsoWC3GmhNdwVFomW3QjH3
Diffstat (limited to 'packages/meshbay-node/tests/test_task_lifetime.py')
-rw-r--r--packages/meshbay-node/tests/test_task_lifetime.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/meshbay-node/tests/test_task_lifetime.py b/packages/meshbay-node/tests/test_task_lifetime.py
index 3a5b8a5..9dffedb 100644
--- a/packages/meshbay-node/tests/test_task_lifetime.py
+++ b/packages/meshbay-node/tests/test_task_lifetime.py
@@ -245,8 +245,13 @@ def test_chunks_wait_for_room_on_the_channel(session):
work through the rest — which is what "stuck at 1 MB" looks like, one chunk
being exactly one megabyte.
"""
- fn = session[session.index("async def _do_file_request"):]
- fn = fn[:fn.index("\n def _do_stream_segment")]
+ start = session.index("async def _do_file_request")
+ # Up to whatever the next member is. This used to end at
+ # "\n def _do_stream_segment" — a neighbour removed in MNP 2.0 — and an
+ # `index()` on a name that no longer exists fails the test for a reason
+ # that has nothing to do with what it is about.
+ nxt = re.search(r"\n (?:@|(?:async )?def )", session[start:])
+ fn = session[start:start + nxt.start()] if nxt else session[start:]
assert "DOWNLOAD_BUFFER_HIGH" in fn, "the send buffer has to be watched"
assert "await asyncio.sleep" in fn, "waiting for room is the point"
assert 'readyState != "open"' in fn, (