aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_video_root_gates_enrichment.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-10 17:49:58 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-10 17:49:58 +0200
commit07ff8b4f6143039fcc74b8cf7c423282bce093c1 (patch)
tree89e095aeef9f5ad0bcbe7b3e6cfdc67d36bcbba8 /packages/meshbay-node/tests/test_video_root_gates_enrichment.py
parent1e6f3861a1570029897a30b42121836fd03565c1 (diff)
downloadmeshbay-07ff8b4f6143039fcc74b8cf7c423282bce093c1.tar.gz
refactor(mnp)!: one operation for an app's folders, not one per app
`video_root`, `audio_root` and `photo_roots` are gone — the messages, the signed operations, the handlers, the `ops` wrappers, the three scalars on the handshake ack, and the client's handlers for their acks. `app_directories` does the same thing for every application, keyed by the app's own registry name, and it is what the SPA has been sending. The three were the same instruction three times, differing only in the key they wrote and whether they carried a string or a list. That shape is what made adding an application mean adding a message type, an op, a handler and a widget; it also meant three validation paths, and the older ones validated nothing — a typo was stored and then quietly matched no entry, an app showing an empty tab with no way to tell "misconfigured" from "no files yet". **What stays, and why.** `Roster.LEGACY_DIR_KEYS` still reads `video_root` and friends out of `group_settings`: that is a key on an operator's disk, not on the wire, and a node upgraded into this must find its own configuration. The Search page still reads its own older cache keys, for the same reason — the cache outlives a deploy. `CTX_ALIASES` keeps only `chat`, which is the one app whose second name something still reads. The two per-app policy test files go with the messages. What only they held — the real challenge/response path from message to database, which no other test exercises — is retargeted at `app_directories` in `test_app_directories_signed.py`, and the handler's own refusals (unknown app, malformed `directories`, nobody to authorize it) join `test_app_directories.py`. Node and common suites 1368 passed. 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_video_root_gates_enrichment.py')
-rw-r--r--packages/meshbay-node/tests/test_video_root_gates_enrichment.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/meshbay-node/tests/test_video_root_gates_enrichment.py b/packages/meshbay-node/tests/test_video_root_gates_enrichment.py
index b88ecaf..fd0e040 100644
--- a/packages/meshbay-node/tests/test_video_root_gates_enrichment.py
+++ b/packages/meshbay-node/tests/test_video_root_gates_enrichment.py
@@ -6,7 +6,7 @@ rate limit and the node's CPU on an operator's whole shared index before
they have chosen which folder is actually their media library would be
real, ongoing cost for files never meant to be in the Videos app at all.
-Setting or changing the root (ops.set_video_root) fires a one-off sweep
+Setting or changing the folder (ops.set_app_directory) fires a one-off sweep
(_enrich_video_root_now) of whatever it already contains: the ordinary
per-broadcast path only ever looks at files new since the last broadcast,
so anything already sitting in a folder before it became the video_root
@@ -144,7 +144,8 @@ async def test_setting_the_video_root_sweeps_what_it_already_contains(tmp_path):
"groups_ctx": {group_id: {"roots": one_root(shared)}},
"enrich_app_dirs_fns": {"video": daemon._enrich_video_root_now},
}
- await ops.set_video_root(state, group_id, "shared/Movies")
+ await ops.set_app_directory(state, group_id, "video",
+ "shared/Movies")
await asyncio.sleep(0.05) # let the fire-and-forget sweep actually run
entry = next(iter(indexer.index.entries))