diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-15 12:57:51 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-15 12:57:51 +0200 |
| commit | a86bced1640ac1a695b95ac68b95e3fc581e687d (patch) | |
| tree | fe8ea8af945e139a2308eb19ad572e10a41b05e4 /packages/meshbay-node/tests/test_chat_is_bounded.py | |
| parent | 988a0eecd522431980174910db28e45a63ff2710 (diff) | |
| download | meshbay-a86bced1640ac1a695b95ac68b95e3fc581e687d.tar.gz | |
refactor(chat): no thread_id — chat has no threads
Nothing ever set it (the page and the CLI sent null) and nothing read it
(the node's get_thread had no caller). It is no longer sent by the page or
the CLI, in clear or in the sealed payload, nor relayed or served by the
node; get_thread and its index are gone, and the protocol and design docs
no longer name it.
The node still accepts a chat_msg carrying one, from the desktop apps and
CLIs already installed, and drops it. The column stays, empty, in chat.db:
a node downgraded to an older version names it in every query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/test_chat_is_bounded.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_chat_is_bounded.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/meshbay-node/tests/test_chat_is_bounded.py b/packages/meshbay-node/tests/test_chat_is_bounded.py index c48f26d..f98fd81 100644 --- a/packages/meshbay-node/tests/test_chat_is_bounded.py +++ b/packages/meshbay-node/tests/test_chat_is_bounded.py @@ -210,10 +210,10 @@ async def test_one_member_at_their_limit_has_not_spent_anyone_elses(ctx, store): async def test_the_clear_fields_are_what_they_claim_and_no_larger(ctx, store): """ - `sender_name` and `thread_id` travel in clear beside the sealed envelope, - which carries its own. They are stored on the operator's disk and relayed - to every member, so a megabyte of name or a list for a thread id is dropped, - not kept. + `sender_name` travels in clear beside the sealed envelope, which carries its + own. It is stored on the operator's disk and relayed to every member, so a + megabyte of name is dropped, not kept — and a `thread_id`, which an older + client still sends, is neither. """ alice = _session(ctx, store, user="alice", conn="c1") bob = _session(ctx, store, user="bob", conn="c2") @@ -225,17 +225,19 @@ async def test_the_clear_fields_are_what_they_claim_and_no_larger(ctx, store): stored = (await store.get_recent(limit=1))[0] assert stored.sender_name in ("", None) - assert stored.thread_id is None relayed = [m for m in bob.sent if m.get("type") == "chat_msg"] - assert relayed and relayed[-1]["sender_name"] == "" and relayed[-1]["thread_id"] is None + assert relayed and relayed[-1]["sender_name"] == "" and "thread_id" not in relayed[-1] -async def test_ordinary_clear_fields_pass_unchanged(ctx, store): +async def test_an_older_clients_message_is_taken_its_thread_id_ignored(ctx, store): alice = _session(ctx, store, user="alice", conn="c1") + bob = _session(ctx, store, user="bob", conn="c2") msg = _message(alice, size=64) msg["sender_name"] = "Alice" msg["thread_id"] = "42" alice._do_chat_message(msg) await _drain(ctx) stored = (await store.get_recent(limit=1))[0] - assert (stored.sender_name, stored.thread_id) == ("Alice", "42") + assert stored.sender_name == "Alice" + relayed = [m for m in bob.sent if m.get("type") == "chat_msg"] + assert relayed and "thread_id" not in relayed[-1] |