fix(update): recover from stalled panel self-update instead of hanging at 80%
Some checks failed
Deploy to Production / Trigger production update (push) Has been cancelled
Backend Tests / pytest (Python 3.12) (push) Has been cancelled

The panel update status lived only in-memory and was cleared solely by the
host watchdog restarting the container. If the rebuild failed mid-way (e.g. the
build OOMs the host when no swap is configured), the container never restarted
and the UI stayed at "restarting - 80%" forever.

- update_service: get_update_status() now self-heals — after UPDATE_TIMEOUT_SECONDS
  (default 900s) of "is_updating" it transitions to a terminal "failed" state with
  a clear error pointing at the host update service / logs.
- use-settings: poll update status while the server reports is_updating (not only
  right after the click in the same tab), so reloading a stuck page keeps refreshing.
- SettingsPage: banner now renders the "failed" state with the error message.
- update_host.sh: build images sequentially (app, then frontend) to lower peak
  memory and avoid the OOM that killed the build mid-run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
markmorado
2026-07-23 22:57:41 +05:00
parent ceec83d2fb
commit e67f6b7249
6 changed files with 85 additions and 14 deletions

View File

@@ -668,11 +668,24 @@ function AboutTab() {
</div>
)}
{/* Update in progress banner */}
{status?.is_updating && (
<div className="rounded-md border border-warning/40 bg-warning/10 p-3 text-sm">
<p className="font-medium">{t('settings.update_in_progress')}</p>
<p className="text-xs text-muted-foreground">{status.stage} — {status.progress}%</p>
{/* Update in progress / failed banner */}
{status && (status.is_updating || status.stage === 'failed' || status.error) && (
<div className={`rounded-md border p-3 text-sm ${
status.stage === 'failed' || status.error
? 'border-destructive/40 bg-destructive/10'
: 'border-warning/40 bg-warning/10'
}`}>
{status.stage === 'failed' || status.error ? (
<>
<p className="font-medium text-destructive">{t('settings.update_failed')}</p>
{status.error && <p className="mt-1 text-xs text-muted-foreground">{status.error}</p>}
</>
) : (
<>
<p className="font-medium">{t('settings.update_in_progress')}</p>
<p className="text-xs text-muted-foreground">{status.stage} — {status.progress}%</p>
</>
)}
<Button size="sm" variant="ghost" className="mt-2" onClick={() => resetUpdate.mutate()} disabled={resetUpdate.isPending}>
{t('settings.update_reset')}
</Button>