From 5898cb81be29dfe45513d40bda4c2eee275e7b9d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 7 Nov 2025 08:11:52 +0000 Subject: [PATCH] Fix update modal hanging indefinitely after completion (related to #628) When updates complete quickly, the status API may return 'completed' before the frontend detects the 'restarting' phase. This left users staring at a frozen modal with no feedback, requiring manual page refresh. Changes: - When status is 'completed', immediately check /api/health - If backend is healthy, reload the page to get new version - If health check fails, assume restart in progress and start health polling - Ensures users always get reloaded to the new version automatically This fixes the UX issue reported in discussion #628 where the update modal appeared frozen indefinitely despite successful update completion. --- .../src/components/UpdateProgressModal.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/frontend-modern/src/components/UpdateProgressModal.tsx b/frontend-modern/src/components/UpdateProgressModal.tsx index 4ef273d53..589dc9d1b 100644 --- a/frontend-modern/src/components/UpdateProgressModal.tsx +++ b/frontend-modern/src/components/UpdateProgressModal.tsx @@ -49,6 +49,28 @@ export function UpdateProgressModal(props: UpdateProgressModalProps) { currentStatus.status === 'idle' || currentStatus.status === 'error' ) { + // If completed successfully, verify backend health and reload to get new version + if (currentStatus.status === 'completed' && !currentStatus.error) { + if (pollInterval) { + clearInterval(pollInterval); + } + // Verify backend is healthy and reload + try { + const healthCheck = await fetch('/api/health', { cache: 'no-store' }); + if (healthCheck.ok) { + logger.info('Update completed, backend healthy, reloading...'); + window.location.reload(); + return; + } + } catch (error) { + logger.warn('Update completed but health check failed, assuming restart...', error); + } + // If health check failed, assume restart in progress + setIsRestarting(true); + startHealthCheckPolling(); + return; + } + setIsComplete(true); if (currentStatus.status === 'error' || currentStatus.error) { setHasError(true);