Skip to content

Commit 28350f3

Browse files
Admin: don't poll version while the update status is stuck
A stale 'running' status still reads state==='running', so the 4s poll (check=false) kept overwriting a just-fetched 'update available' result, making it flash and vanish. Gate the poll on '!stuck' so a check result persists when the panel is in the stuck state.
1 parent 5a63e2d commit 28350f3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/app/(app)/admin/UpdatePanel.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export function UpdatePanel() {
6565

6666
// Poll while an update is running (survives the API restart it triggers).
6767
useEffect(() => {
68-
const running = info?.status.state === 'running';
68+
// Poll only while an update is ACTUALLY in progress — not when the status is stuck/stale,
69+
// otherwise the 4s poll (check=false) keeps wiping a "Check for updates" result.
70+
const running = info?.status.state === 'running' && !info?.stuck;
6971
if (running && !pollRef.current) {
7072
pollRef.current = setInterval(() => {
7173
void fetchVersion(false).catch(() => {
@@ -83,7 +85,7 @@ export function UpdatePanel() {
8385
pollRef.current = null;
8486
}
8587
};
86-
}, [info?.status.state, fetchVersion]);
88+
}, [info?.status.state, info?.stuck, fetchVersion]);
8789

8890
async function check() {
8991
setBusy('check');

0 commit comments

Comments
 (0)