hermes-agent/apps/desktop/electron
brooklyn! 529ee80ac0
Recover from a half-replaced desktop bundle instead of requiring a reinstall (#85887)
* fix(desktop): load the intact renderer bundle when an update tears one copy

index.html and the hashed chunks it names are one generation. A packaged app
ships that bundle twice (inside app.asar and, via asarUnpack, beside it in
app.asar.unpacked), so an update that replaces the app while its files are
locked can leave the two copies from different generations. resolveRendererIndex
took the first index.html that existed, so it could pick the torn one and the
window died on its first lazy import with "Failed to fetch dynamically imported
module" -- with no way out, because every relaunch reloaded the same copy.

Check each candidate's declared modules and prefer a complete generation; when
both are torn, log which files are missing and how to repair instead of leaving
the crash unexplained.

* fix(cli): rebuild the desktop app when its renderer bundle is half-replaced

The content stamp hashes the SOURCE tree, which an interrupted update leaves
intact, so `hermes desktop` reported "up to date" and skipped the rebuild that
would repair a torn bundle -- the app relaunched into the same crash and
reinstalling looked like the only option.

Treat a bundle whose index.html names missing chunks as stale regardless of the
stamp, and say so on the way into the rebuild.
2026-08-14 02:21:20 -05:00
..
active-runtime-state.test.ts
…
active-runtime-state.ts
…
backend-child.ts
…
backend-command.test.ts test(desktop): move node tests to vitest as well 2026-07-13 17:22:17 -04:00
backend-command.ts
…
backend-connection-state.test.ts
…
backend-connection-state.ts
…
backend-env.test.ts
…
backend-env.ts
…
backend-health.test.ts
…
backend-health.ts
…
backend-probes.test.ts
…
backend-probes.ts
…
backend-ready.test.ts
…
backend-ready.ts
…
backend-start-failure.test.ts
…
backend-start-failure.ts
…
bootstrap-platform.test.ts fmt(js): `npm run fix` on merge (#85010) 2026-08-13 03:33:45 +00:00
bootstrap-platform.ts
…
bootstrap-repair-guard.test.ts
…
bootstrap-repair-guard.ts
…
bootstrap-runner.test.ts
…
bootstrap-runner.ts
…
connection-apply.test.ts
…
connection-apply.ts
…
connection-config.test.ts
…
connection-config.ts
…
crash-forensics.test.ts
…
crash-forensics.ts
…
dashboard-token.test.ts
…
dashboard-token.ts
…
desktop-electron-pin.test.ts
…
desktop-installation.test.ts
…
desktop-installation.ts
…
desktop-uninstall.test.ts
…
desktop-uninstall.ts
…
dev-cdp.test.ts
…
dev-cdp.ts
…
embed-referer.ts
…
entitlements.mac.inherit.plist
…
entitlements.mac.plist
…
event-dedupe.test.ts
…
event-dedupe.ts
…
find-git-bash.test.ts
…
find-git-bash.ts
…
find-in-page.test.ts
…
find-in-page.ts
…
first-run-setup-gate.test.ts
…
first-run-setup-gate.ts
…
first-run-setup-main-process.test.ts
…
fs-read-dir.test.ts
…
fs-read-dir.ts
…
gateway-ws-probe.test.ts
…
gateway-ws-probe.ts
…
git-repo-scan.test.ts
…
git-repo-scan.ts
…
git-review-ops.test.ts
…
git-review-ops.ts feat(desktop): paste a PR review comment as structured composer context 2026-08-12 22:48:00 -05:00
git-root.test.ts
…
git-root.ts
…
git-worktree-ops.test.ts
…
git-worktree-ops.ts
…
handoff-result.test.ts
…
handoff-result.ts
…
hardening.test.ts fix(desktop): create connection.json owner-only 2026-08-12 22:38:17 -07:00
hardening.ts fix(desktop): create connection.json owner-only 2026-08-12 22:38:17 -07:00
hud-cursor.test.ts
…
hud-cursor.ts
…
hud-snap-shortcut.test.ts
…
hud-snap-shortcut.ts
…
hud-snap.test.ts
…
hud-snap.ts
…
hud-url.test.ts
…
hud-url.ts
…
hyprland.test.ts
…
hyprland.ts
…
link-title-window.test.ts
…
link-title-window.ts
…
main-window-lifecycle.test.ts
…
main-window-lifecycle.ts
…
main.ts Recover from a half-replaced desktop bundle instead of requiring a reinstall (#85887) 2026-08-14 02:21:20 -05:00
native-auth-decisions.test.ts
…
native-auth-decisions.ts
…
native-oauth-login.test.ts
…
native-oauth-login.ts
…
native-oauth.test.ts
…
native-oauth.ts
…
native-token-store.test.ts
…
native-token-store.ts
…
oauth-net-request.test.ts
…
oauth-net-request.ts
…
power-save.test.ts
…
power-save.ts
…
preload.ts feat(desktop): load a desktop half from unified agent-plugin packages 2026-08-13 13:18:49 -05:00
primary-backend-startup.test.ts
…
primary-backend-startup.ts
…
primary-connection-rehome.ts
…
profile-delete-routing.test.ts
…
profile-delete-routing.ts
…
profile-session-routing.test.ts
…
profile-session-routing.ts
…
quick-entry.test.ts
…
quick-entry.ts
…
quit-guard.test.ts
…
quit-guard.ts
…
remote-lifecycle.test.ts
…
remote-lifecycle.ts
…
remote-liveness.test.ts
…
remote-liveness.ts
…
renderer-bundle.ts Recover from a half-replaced desktop bundle instead of requiring a reinstall (#85887) 2026-08-14 02:21:20 -05:00
renderer-log.test.ts
…
renderer-log.ts
…
session-windows.test.ts
…
session-windows.ts
…
spawn-helper-perms.test.ts
…
spawn-helper-perms.ts
…
ssh-bootstrap-coordinator.test.ts
…
ssh-bootstrap-coordinator.ts
…
ssh-config.test.ts
…
ssh-config.ts
…
ssh-connection.test.ts
…
ssh-connection.ts
…
stream-throttle.test.ts
…
stream-throttle.ts
…
titlebar-overlay-width.test.ts
…
titlebar-overlay-width.ts
…
update-count.test.ts
…
update-count.ts
…
update-gate.test.ts
…
update-gate.ts
…
update-marker.test.ts
…
update-marker.ts
…
update-remote.test.ts
…
update-remote.ts
…
updater-process.test.ts
…
updater-process.ts
…
venv-blocker-scan.test.ts
…
venv-blocker-scan.ts
…
vscode-marketplace.test.ts
…
vscode-marketplace.ts
…
wake-indicator-window.ts
…
wake-indicator.test.ts
…
wake-indicator.ts
…
window-below.test.ts
…
window-below.ts
…
window-renderer-lifecycle.test.ts
…
window-renderer-lifecycle.ts
…
window-reveal.test.ts
…
window-reveal.ts
…
window-state.test.ts
…
window-state.ts
…
windows-child-options.test.ts
…
windows-child-options.ts
…
windows-hermes-path.test.ts
…
windows-hermes-path.ts
…
windows-remote-lifecycle.test.ts
…
windows-remote-lifecycle.ts
…
windows-remote-live.test.ts
…
windows-sandbox-fallback.test.ts
…
windows-sandbox-fallback.ts
…
windows-system-ca.test.ts
…
windows-system-ca.ts
…
windows-user-env.test.ts
…
windows-user-env.ts
…
workspace-cwd.test.ts
…
workspace-cwd.ts
…
wsl-clipboard-image.test.ts
…
wsl-clipboard-image.ts
…
wsl-path-bridge.test.ts
…
wsl-path-bridge.ts
…
zoom.test.ts
…
zoom.ts
…