diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-27 22:21:07 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-27 22:21:07 +0200 |
| commit | c7899e2218af26f3bab6a157c70acf5eb7871da6 (patch) | |
| tree | 5ed08cfbf26cdd8d9dbf6ce1159fc259d611df2d /packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js | |
| parent | 7422a777297347dc83e6c5b2e89c1a6fa99a36b0 (diff) | |
| download | meshbay-c7899e2218af26f3bab6a157c70acf5eb7871da6.tar.gz | |
fix(hub): the sidebar's Node section follows the node link
Reported on a real install: after the first click on Create group, the Node
section (Node, Create group) disappeared from the sidebar until a reload,
although the group was created and the node ran.
hasNodeKey was read once per session change and never again, so a node the
wizard linked stayed out of the sidebar; and that read swallowed its errors,
so a session blip (a refused renewal, then the desktop app's silent device
sign-in) followed by one failed request hid the section for good. The wizard
now tells the app when it has linked or started a node, the app asks again
then and after a group is created, and a failed read is retried -- never
applied to a session that has changed meanwhile.
The wizard also starts the node on its own for a node in waiting_for_hub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js index 85fe53c..7556010 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js @@ -124,7 +124,7 @@ function CreateGroupFormSimple({ token, onCreated, allowPublicGroups = true }) { `; } -function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = true }) { +function CreateGroupWizard({ token, username, onCreated, onNodeLinked, allowPublicGroups = true }) { const [step, setStep] = useState(0); const [nodeStatus, setNodeStatus] = useState(null); const [nodeStarting, setNodeStarting] = useState(false); @@ -151,7 +151,10 @@ function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = tru await hubFetch('/v1/users/me/node_key', { method: 'PUT', token, body: { pk_node_ed25519: pk }, }); - }, [token]); + // The sidebar's Node section depends on this link; it only re-read it at + // sign-in, so the first node set up here stayed out of it until a reload. + if (onNodeLinked) onNodeLinked(); + }, [token, onNodeLinked]); const detectNode = useCallback(async () => { setNodeStatus(null); @@ -177,6 +180,8 @@ function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = tru setError(''); try { const result = await platform.node.start({ hubUrl: HUB, username, token }); + // node.start links the key from the main process, out of this page's sight. + if (onNodeLinked) onNodeLinked(); setNodeStatus({ detected: true, ...result }); setNodeStarting(false); setStep(1); @@ -337,6 +342,7 @@ function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = tru && !provisionAttempted.current && (nodeStatus.status === 'waiting_for_account' || nodeStatus.status === 'waiting_for_node_key' + || nodeStatus.status === 'waiting_for_hub' || nodeStatus.status === 'starting')) { provisionAttempted.current = true; startNode(); |