From e12570f9d1aa2645e6bb223b1417fa0e81957b65 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 14 Sep 2026 23:51:36 +0200 Subject: fix(win): a service-mode daemon can be replaced, and the Node page can link one Two live-reproduced bugs in Windows node start/stop, found sideloading the 0.14.0 build: - node:start's crash-recovery step killed a service-mode daemon with taskkill/CTRL_BREAK, both of which fail with "Access is denied" against a process running under the Scheduled Task's own S4U logon session (a different session from the Electron app's). The daemon it was meant to replace just kept running, unreplaced, and schtasks /run on a task Windows still considered Running was then a silent no-op too. Route through winServiceTaskEnd() (schtasks /end) first, the way nodeServiceStop/ nodeServiceRestart already correctly do. service-mode.ps1 also now starts the task right after registering it -- Register-ScheduledTask's own AtStartup trigger does not run it immediately, so nothing was listening until the next reboot. - The Node page's Start button called node.start() with no arguments, so an unlinked node (a fresh install, or one whose hub-side link was lost) could never link on Start alone -- only create-group-page.js's own call passed {hubUrl, username, token}. Reproduced on a fresh non-service install signed in to the real hub: Start hung for ~105s and failed with "could not link", pointing at a "Link Node" control that lives on Settings, not the Node page (that message is fixed too). Co-Authored-By: Claude Sonnet 5 --- .../src/meshbay_hub/static/node-page.js | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/node-page.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js index 6dcaa58..0f75edc 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/node-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/node-page.js @@ -4,6 +4,7 @@ import { import { t } from './i18n.js'; import * as platform from './platform.js'; import { Icon } from './icon.js'; +import { HUB } from './hub-client.js'; // ── Node management (D5) ──────────────────────────────────────────────────── // @@ -11,7 +12,7 @@ import { Icon } from './icon.js'; // (platform.node.call), not over MNP/WebRTC. The MNP protocol types remain // for potential future browser-side use. -function NodeServicePanel({ onChanged }) { +function NodeServicePanel({ onChanged, token, username }) { const [info, setInfo] = useState(null); const [busy, setBusy] = useState(''); const [err, setErr] = useState(''); @@ -77,6 +78,16 @@ function NodeServicePanel({ onChanged }) { }); }, [act, info]); + // The Start button below passes {hubUrl, username, token} to node:start, + // same as create-group-page.js's own startNode() -- node:start only links + // an unlinked node key to the hub account when given credentials to link + // it with (main.js's linkNodeKeyAndAwaitRunning). Without them, a node that + // is not linked yet (a fresh install, or one whose hub-side link was lost) + // just polls for up to 105s and fails with "could not link", pointing at a + // "Link Node" control that lives on Settings, not here. Reproduced live + // 2026-09-14: a fresh non-service install's own Start button hung and + // failed this way, the exact same account and key that had just linked + // fine through the Create Group wizard. if (!platform.node.service.available) return null; if (!info || info.supported === false) { return html`
@@ -108,7 +119,7 @@ function NodeServicePanel({ onChanged }) { ${err && html`
${err}
`}
${info.installed && html`
`; } if (status === 'error') { return html`

${t('node.title')}

- <${NodeServicePanel} onChanged=${fetchStatus} /> + <${NodeServicePanel} onChanged=${fetchStatus} token=${token} username=${username} />

${error}

@@ -686,7 +697,7 @@ export function NodePage({ groups }) { onClick=${reloadConfig}> ${t('node.reload')}
- <${NodeServicePanel} onChanged=${fetchStatus} /> + <${NodeServicePanel} onChanged=${fetchStatus} token=${token} username=${username} /> ${actionMsg && html`
${actionMsg}
`} ${!operatorPaired && html`
-- cgit v1.2.3