From 6348698322e5bfcb80d0ef0dcd833ba4e6179640 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 25 Sep 2026 11:09:12 +0200 Subject: test(hub): read the transport wherever it is split spa_source.transport_files() takes the classic transport*.js scripts from the hub's shell, in load order. Every test that read transport.js reads them all, the Node harnesses run them joined as one scope, the chat probe loads each, and the desktop shell must load them in order. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/harness/chat_send_probe.py | 10 ++++++++-- packages/meshbay-hub/tests/harness/index_seal_probe.mjs | 6 +++++- packages/meshbay-hub/tests/harness/offer_retry_harness.mjs | 4 +++- packages/meshbay-hub/tests/harness/upload_seal_probe.mjs | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) (limited to 'packages/meshbay-hub/tests/harness') diff --git a/packages/meshbay-hub/tests/harness/chat_send_probe.py b/packages/meshbay-hub/tests/harness/chat_send_probe.py index d343c50..7569628 100644 --- a/packages/meshbay-hub/tests/harness/chat_send_probe.py +++ b/packages/meshbay-hub/tests/harness/chat_send_probe.py @@ -77,6 +77,9 @@ import threading import time from pathlib import Path +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +from spa_source import transport_files # noqa: E402 + STATIC = Path(__file__).resolve().parents[2] / "src" / "meshbay_hub" / "static" PORT = 8755 RECORDS = [] @@ -104,7 +107,10 @@ def _page() -> str: .replace("__GROUP_ID__", GROUP_ID) .replace("__GEK_HEX__", GEK.hex()) .replace("__KEYS_NONCE_HEX__", sealed["nonce"].hex()) - .replace("__KEYS_CT_HEX__", sealed["ct"].hex())) + .replace("__KEYS_CT_HEX__", sealed["ct"].hex()) + # transport.js and the parts split out of it, in the shell's order. + .replace("__TRANSPORT_SCRIPTS__", "\n".join( + f'' for p in transport_files()))) PAGE_TEMPLATE = r""" @@ -119,7 +125,7 @@ PAGE_TEMPLATE = r""" Without them a send fails with "cannot read properties of undefined". --> - +__TRANSPORT_SCRIPTS__