diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-10 17:29:50 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-10 17:29:50 +0200 |
| commit | 4753c67816c774323e3ab4efc76d3259e8ded40d (patch) | |
| tree | 0ac0b8a3013aa483111ea249e3aa37ff49988891 /packages/meshbay-hub/src/meshbay_hub/static/group-settings.js | |
| parent | 1dcedc77083b908b7b3b431bad679a4813884355 (diff) | |
| download | meshbay-4753c67816c774323e3ab4efc76d3259e8ded40d.tar.gz | |
refactor(spa): stop asking a node what version it is
`MNP_MIN_SUPPORTED` is the version this build speaks, so `check_version`
refuses everything below it at the handshake. Every capability the client was
gating on the node's version is therefore true of every peer it can reach:
* `supportsSealedUpload` — an upload is sealed or it is not sent;
* `supportsAppOps` — one `app_directories` op, and no `setVideoRoot` /
`setAudioRoot` / `setPhotoRoots` wrappers behind it;
* `supportsTransferSlots` and `Lease._skip()` — a lease is always real, so
there is no branch where a transfer runs without one;
* `legacyNode`, the read-only shared-directories table, and the two hints
telling an operator their node is too old to configure an app.
The version the node declares is still recorded, for diagnostics. Nothing
branches on it, and the comment says so, because a field kept "just in case" is
how the branches came back last time.
`test_mnp_1_0_node_compat.py` goes with them: it existed to hold the fallbacks
in place, and holding a fallback that cannot execute is how a suite starts
lying. The two locale strings for those hints are removed from all ten
catalogues.
Hub suite 872 passed (test_sticky_header deselected — failing before this).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AsoWC3GmhNdwVFomW3QjH3
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-settings.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/group-settings.js | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js index dce5833..8e11088 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js @@ -40,7 +40,6 @@ import * as platform from './platform.js'; * transport — MeshBayTransport instance, or null when not connected * signFn — signing function for admin ops * nodeDetected — whether the loopback node API answers - * readOnly — suppress every edit control * onRootsChange — called after a change, to re-read the loopback list * onRefreshIndex — full index refresh. Not called after a root change: see * `run()` for why the node's own push is what settles it @@ -48,7 +47,7 @@ import * as platform from './platform.js'; * localRoots / onLocalRootsChange — the array, in "local" mode */ function SharedDirectoriesTable({ roots, groupId, transport, signFn, - nodeDetected: nodeAvail, readOnly, + nodeDetected: nodeAvail, onRootsChange, onRefreshIndex, mode = 'live', localRoots, onLocalRootsChange }) { @@ -116,7 +115,7 @@ function SharedDirectoriesTable({ roots, groupId, transport, signFn, // API is not (it is authorized by being on localhost with the run token). const overMnp = !isLocal && transport && transport.connected; const overLoopback = !isLocal && !overMnp && nodeAvail; - const canEdit = !readOnly && (isLocal || overMnp || overLoopback); + const canEdit = isLocal || overMnp || overLoopback; const rootUrl = (name, suffix = '') => '/api/groups/' + groupId + '/roots/' + encodeURIComponent(name) + suffix; @@ -401,7 +400,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, enabledApps, onEnabledApps, scanSettings, onScanSettings, entries, nodeDirs, - appSettings, nodeSupportsAppOps, + appSettings, onAppDirectories, onRefreshIndex, onPaired, onLeft }) { const [members, setMembers] = useState([]); @@ -693,14 +692,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, if (!transport || !transport.connected) { throw new Error(t('node.root_no_route')); } - // A node too old for the generic op still answers the three per-app - // messages that came before it, so an operator on one keeps the ability - // they had rather than being handed a control that times out. - if (transport.supportsAppOps) { - await transport.setAppDirectories(appKey, paths, adminSignFn); - } else { - await transport.setAppDirectoriesLegacy(appKey, paths, adminSignFn); - } + await transport.setAppDirectories(appKey, paths, adminSignFn); if (onAppDirectories) onAppDirectories(appKey, paths); }, [transportRef, adminSignFn, onAppDirectories]); @@ -898,19 +890,11 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, <p class="settings-hint">${t('settings_node.shared_directories_hint')}</p> ${!connected && nodeDetected && html` <p class="settings-hint">${t('settings_node.roots_offline_hint')}</p>`} - ${/* Read-only against a node that predates the root operations: - writable, removable, eject and plug have no older equivalent - to fall back to, and an unknown message type is dropped - unanswered — a thirty-second wait ending in a timeout, with - nothing on screen to say the node simply cannot do it. */''} - ${connected && !nodeSupportsAppOps && !nodeDetected && html` - <p class="settings-hint">${t('settings_node.roots_node_too_old')}</p>`} <${SharedDirectoriesTable} roots=${effectiveRoots} groupId=${groupId} transport=${transportRef.current} signFn=${adminSignFn} - readOnly=${connected && !nodeSupportsAppOps && !nodeDetected} nodeDetected=${nodeDetected} onRootsChange=${loadNodeInfo} onRefreshIndex=${onRefreshIndex} /> @@ -937,9 +921,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, disabled=${appsBusy} onChange=${() => toggleApp(app.key)} /> `}> - ${!nodeSupportsAppOps && app.key === 'chat' - ? html`<p class="settings-hint">${t('settings_node.app_node_too_old')}</p>` - : activeApps.includes(app.key) + ${activeApps.includes(app.key) ? html`<${app.Settings} roots=${effectiveRoots} dirs=${folderOptions} settings=${appSettings} |