From 2a7925b362767dcdf7867384cdcdda18f53adbbe Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 25 Mar 2026 00:39:14 +1300 Subject: [PATCH] (fix): installer resume detects terminal snapshots and redirects cleanly --- .../install/installer/js/modules/progress.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/views/install/installer/js/modules/progress.js b/app/views/install/installer/js/modules/progress.js index ac44093593..00eaa65c17 100644 --- a/app/views/install/installer/js/modules/progress.js +++ b/app/views/install/installer/js/modules/progress.js @@ -693,6 +693,7 @@ } stopSyncedSpinnerRotation(); setUnloadGuard(false); + clearInstallLock?.(); }; const SSL_STEP = { @@ -909,9 +910,22 @@ } }; + const isSnapshotTerminal = (snapshot) => { + if (!snapshot?.steps) return true; + const stepEntries = Object.values(snapshot.steps); + if (stepEntries.length === 0) return true; + const hasError = stepEntries.some((s) => s.status === STATUS.ERROR); + if (hasError) return true; + const allCompleted = INSTALLATION_STEPS.every((step) => { + const detail = snapshot.steps[step.id]; + return detail && detail.status === STATUS.COMPLETED; + }); + return allCompleted; + }; + const resumeInstall = async (installId) => { const snapshot = await fetchInstallStatus(installId); - if (!snapshot) return false; + if (!snapshot || isSnapshotTerminal(snapshot)) return false; activeInstall = { installId, controller: new AbortController(), @@ -1052,9 +1066,7 @@ if (!resumed) { clearInstallId?.(); clearInstallLock?.(); - const newInstallId = generateInstallId(); - storeInstallId?.(newInstallId); - startInstallStream(newInstallId); + window.location.href = '/?step=1'; } }); } else {