fix(desktop): recover the backend update overlay after the remote restarts

The backend Install path set stage:'restart' and stopped — in remote mode no
boot-progress events arrive to carry the overlay to done, so it sat on the
restarting spinner until a manual reload while the backend had already come
back. Poll the backend until it answers again, then clear the overlay and
refresh the backend status. Target-aware applying copy explains the remote
restart + auto-reconnect instead of the local-updater-window wording.

Also switch the apply poll sleeps from window.setTimeout to globalThis.setTimeout
so the flow is exercisable off the renderer.
This commit is contained in:
yoniebans
2026-06-08 08:58:26 -07:00
committed by Teknium
parent 9b2a64fa6a
commit 81647458c7
8 changed files with 75 additions and 14 deletions
+4 -3
View File
@@ -92,7 +92,7 @@ export function UpdatesOverlay() {
className="max-w-sm overflow-hidden border-border/70 p-0 gap-0"
showCloseButton={phase !== 'applying'}
>
{phase === 'applying' && <ApplyingView apply={apply} />}
{phase === 'applying' && <ApplyingView apply={apply} isBackend={isBackend} />}
{phase === 'manual' && (
<ManualView command={apply.command ?? 'hermes update'} onDone={() => handleClose(false)} />
@@ -309,10 +309,11 @@ function ManualView({ command, onDone }: { command: string; onDone: () => void }
)
}
function ApplyingView({ apply }: { apply: UpdateApplyState }) {
function ApplyingView({ apply, isBackend }: { apply: UpdateApplyState; isBackend: boolean }) {
const { t } = useI18n()
const u = t.updates
const label = u.stages[apply.stage as DesktopUpdateStage] ?? u.stages.idle
const body = isBackend ? u.applyingBodyBackend : u.applyingBody
const percent =
typeof apply.percent === 'number' && Number.isFinite(apply.percent)
@@ -326,7 +327,7 @@ function ApplyingView({ apply }: { apply: UpdateApplyState }) {
<DialogTitle className="text-center text-xl">{label}</DialogTitle>
<DialogDescription className="text-center text-sm">
{u.applyingBody}
{body}
</DialogDescription>
</div>