From 1dcedc77083b908b7b3b431bad679a4813884355 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 10 Sep 2026 17:23:40 +0200 Subject: refactor(mnp)!: one answer to "may this member write", and it is the root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The group-wide `member_upload` switch is gone: the message, the signed operation, the field on the handshake ack, the `upload` alias on every root in the index payload, and the client's fallback path to it. Whether a member may write has been a property of each root for a while, and that is the model that survives: a single flag over the group cannot express "this library is published read-only and that folder is a drop box", which is the ordinary arrangement. What was left of the switch was a handler that logged a deprecation and acted on nothing, and a client that read `ack.member_upload` whenever the roots carried no `writable` — a second source for one question, with whichever the code consulted first deciding it. `roots.describe()` drops `upload` for the same reason: it was `writable` under an older name, and two names for one boolean is one too many. The paperclip now says "nowhere to write" rather than picking a root, in a group that has none writable. That is the honest answer; the fallback picked whatever came first and failed at send time. Node suite 1215 passed. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01AsoWC3GmhNdwVFomW3QjH3 --- .../tests/test_upload_controls_hidden.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'packages/meshbay-hub/tests/test_upload_controls_hidden.py') diff --git a/packages/meshbay-hub/tests/test_upload_controls_hidden.py b/packages/meshbay-hub/tests/test_upload_controls_hidden.py index f6f476e..a2f9352 100644 --- a/packages/meshbay-hub/tests/test_upload_controls_hidden.py +++ b/packages/meshbay-hub/tests/test_upload_controls_hidden.py @@ -180,19 +180,19 @@ def test_the_answer_comes_from_the_node(app): assert "hubFetch" not in app[idx - 400:idx] -def test_an_older_node_is_treated_as_permissive(app): +def test_there_is_no_group_wide_upload_flag_to_read(app): """ - A node speaking MNP 1.0 sends roots with no `writable` at all, plus the old - group-wide flag. Reading a missing field as "read-only" would close every - group on the older half of the network. + Whether a member may write is a property of each root, and the page must + have no second source for it. + + A group-wide flag beside the per-root answer is a page that can show an + Upload button the node will refuse, or hide one it would have allowed — + and whichever of the two the code happens to consult first decides. """ - assert "ack.member_upload !== false" in app - assert "!== false" in app[app.index("ack.member_upload"): - app.index("ack.member_upload") + 60] - block = app[app.index("const legacyNode"):] - block = block[:block.index("const commonProps")] - assert "writable === undefined" in block, ( - "nothing distinguishes a 1.0 node from one with no writable roots") + assert "member_upload" not in app, ( + "the page reads a group-wide upload flag again") + assert "r.writable" in app or "writable" in app, ( + "the page has to read the per-root answer from somewhere") def test_a_change_reaches_people_already_connected(app): -- cgit v1.2.3