From de10ec949eee879f51668de92f1a4a443508996b Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 8 Nov 2025 23:26:55 +0000 Subject: [PATCH] Fix CRITICAL bug: UpdateProgressModal polling never started (fixes #671) ROOT CAUSE: The onMount hook checked props.isOpen, but onMount only runs ONCE when the component first mounts. Since UpdateProgressModal mounts when the app loads (before the user clicks "Apply Update"), props.isOpen is false at mount time, so polling never initializes. When the user later clicks "Apply Update" and props.isOpen becomes true, onMount doesn't re-run, leaving the modal in a broken state with no polling, no restart detection, and no auto-reload - exactly what users reported (stuck for 30+ mins). SOLUTION: Changed from onMount to createEffect watching props.isOpen. Now: - Polling starts immediately when the modal opens (user clicks "Apply Update") - Polling stops when the modal closes (cleanup) - The entire update flow works as designed This was the ACTUAL bug - the previous commits (global watcher, fallback polling) were helpful additions but didn't fix the root cause. --- .../src/components/UpdateProgressModal.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend-modern/src/components/UpdateProgressModal.tsx b/frontend-modern/src/components/UpdateProgressModal.tsx index ff73f7d..4cbeb73 100644 --- a/frontend-modern/src/components/UpdateProgressModal.tsx +++ b/frontend-modern/src/components/UpdateProgressModal.tsx @@ -169,12 +169,20 @@ export function UpdateProgressModal(props: UpdateProgressModalProps) { } }); - onMount(() => { + // Start/stop polling based on modal visibility + createEffect(() => { if (props.isOpen) { - // Start polling immediately + // Start polling immediately when modal opens pollStatus(); // Then poll every 2 seconds pollInterval = setInterval(pollStatus, 2000) as unknown as number; + } else { + // Stop polling when modal closes + if (pollInterval) { + clearInterval(pollInterval); + pollInterval = undefined; + } + clearHealthCheckTimer(); } });