From e4f61771131be635b9e81a19203a00707b4b19df Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 2 Oct 2026 10:20:09 +0200 Subject: feat(mnp): sharing a folder is decided on the node's machine only (MNP 6.0) root_add, root_update and group_attach leave MNP: adding a directory and switching writable/removable go through the loopback API (native dialog in the desktop app) or the CLI. The operator's Settings tab still lists the roots from any browser, read-only. The desktop app refuses to sign those ops; a loopback flag change now reaches open pages (publish_roots). Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/src/meshbay_node/indexer/indexer.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'packages/meshbay-node/src/meshbay_node/indexer/indexer.py') diff --git a/packages/meshbay-node/src/meshbay_node/indexer/indexer.py b/packages/meshbay-node/src/meshbay_node/indexer/indexer.py index 4b619d7..f0505f7 100644 --- a/packages/meshbay-node/src/meshbay_node/indexer/indexer.py +++ b/packages/meshbay-node/src/meshbay_node/indexer/indexer.py @@ -719,6 +719,21 @@ class DirectoryIndexer: # The table now; the files when the scan ends. await self.on_change(self) + async def publish_roots(self) -> None: + """ + Tell every connected peer the table, after a root's flags were edited + in place (`ops.update_root`). + + A reload compares the edited set with itself and finds nothing to do, + so without this a directory made writable from the operator's own + machine stayed read-only on every open page until something else + happened to push the index. + """ + self._index.roots = self.roots.describe() + self._index.version = int(time.time()) + if self.on_change: + await self.on_change(self) + def _holds(self, root: Root) -> bool: return any(r.folded == root.folded and r.path == root.path for r in self.roots) -- cgit v1.2.3