diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-12 15:48:03 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-12 15:48:22 +0200 |
| commit | 9cc2909cb4a360c81b471ceab1d9578a7655a88e (patch) | |
| tree | da6da7ff43eed10382e72247ef7c84b142a42ca5 /packages/meshbay-hub/src/meshbay_hub/static/app.js | |
| parent | d8885c8df17c60927cb8d1f77ce1745814c6d3b4 (diff) | |
| download | meshbay-9cc2909cb4a360c81b471ceab1d9578a7655a88e.tar.gz | |
fix(packaging): three MSIX first-run regressions found by a real sideload
A second-machine sideload of the MSIX target surfaced three things the
earlier verification round (which only proved the package installs and
runs) had missed:
1. meshbay-node missing from PATH. installer.nsh's customInstall adds
node-runtime\ to HKCU\Environment at install time -- an unelevated
per-user write, never blocked by MSIX's no-elevation rule, only by the
more basic fact that an AppX/MSIX install runs no custom code at all.
packaging/win/ensure-node-path.ps1 (idempotent, no admin verb) plus
main.js's winEnsureNodeOnPath() do it from the app itself instead, once
per launch, shipped to Full and MSIX (not Light, nothing to add there).
Verified live via the Node inspector protocol: the entry was in
HKCU\Environment\Path after a launch, absent before.
2. A daemon that crashes on startup failed silently. spawnNodeDetached()
used stdio: 'ignore', so a real crash reproduced live (a second instance
colliding with the first on 127.0.0.1:18000) left waitForNode()'s
generic 60s timeout as the only failure ever shown. spawnNodeDetachedWatched()
pipes stdio and watches ~2.5s, rejecting immediately with the daemon's
own stderr on an early exit; a survivor has its streams released and
runs fully detached exactly as before. First version bounded the
captured text by line count and a live test showed that cut the actual
OSError line -- two uvicorn/asyncio tracebacks followed it in the real
capture -- so it is bounded by characters instead.
3. No hint that a startup-mode choice exists. The install-time radio page
was the only place this was ever offered, and nothing replaces it now
that no install-time page can exist at all. SetupWelcome (the existing
first-run banner) grew a conditional hint, shown only while a bundled
node is present and neither autostart nor service mode is configured
yet. Considered and rejected: linking straight to the Node page -- its
route is gated on a linked hub node key, false on the exact fresh-install
screen this hint targets, so the link would have been dead on arrival.
New key setup.node_startup_hint, added to all ten locale catalogues.
test_packaging_win.py gained six tests pinning all three (69 total).
Full plan and verification detail: C:\Users\admin\devel\msix-installer.md
section 13 (out of repo).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/app.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js index ba24822..188b389 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js @@ -569,10 +569,38 @@ function HomePage({ groups, notifications, onMarkRead, onPurge, allowPublicGroup // ── First-run welcome (Electron-only, shown once on empty home) ───────────── function SetupWelcome({ onDismiss }) { + // An install-time NSIS page used to be the only place this choice was + // ever offered, and an AppX/MSIX install has no install-time page at all + // (no custom actions, full stop, not just no elevation) -- so a build + // running its own bundled node needs to say so somewhere the user will + // actually see it, not just leave the choice sitting unfound on the Node + // page. Shown only while neither startup mode is configured yet; it + // disappears on its own once one is (or stays hidden forever if the + // platform has no node.service at all, e.g. Light, non-Windows, browser). + const [startupHint, setStartupHint] = useState(false); + useEffect(() => { + let cancelled = false; + (async () => { + try { + if (!platform.node.available || !(await platform.node.bundled())) return; + if (!platform.node.service.available) return; + const status = await platform.node.service.status(); + const configured = status.mode === 'service' || Boolean(status.autostart); + if (!cancelled && status.supported !== false && !configured) setStartupHint(true); + } catch { /* best effort -- the Node page itself is the source of truth */ } + })(); + return () => { cancelled = true; }; + }, []); + return html`<div class="page-content"> <h2>${t('setup.welcome_title')}</h2> <p class="page-message" style="margin-bottom:24px"> ${t('setup.welcome_message')}</p> + ${startupHint && html` + <p class="page-message" style="margin-bottom:24px"> + ${t('setup.node_startup_hint')} + </p> + `} <div style="display:flex;gap:8px;flex-wrap:wrap"> <a class="btn btn-primary" href="#/create-group"> ${t('setup.create_group')}</a> |