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

@@ -217,7 +217,12 @@ export function useUpdateStatus(poll = false) {
return useQuery({
queryKey: settingsKeys.updateStatus,
queryFn: () => apiClient.get<UpdateStatus>('/settings/api/updates/status'),
refetchInterval: poll ? 3000 : false,
// Poll while an update is actually running (server-driven), so a page reload
// on a stuck update keeps refreshing until it succeeds or times out — not
// only right after the user clicked "Update" in this tab. `poll` starts the
// loop immediately after clicking, before the first status arrives.
refetchInterval: (query) =>
poll || query.state.data?.is_updating ? 3000 : false,
});
}