fix: Beállítások endless-refresh loop after a migration (v0.68.3)

The migration journal keeps returning the last completed job; the resume-view
watched any job and migWatch's done-branch reloads the page -> endless reload
loop after any migration. Resume-view now watches only in-progress jobs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 21:43:00 +02:00
parent 37ed7570ca
commit a821a9d7d0
2 changed files with 21 additions and 2 deletions
+15
View File
@@ -1,5 +1,20 @@
## Changelog
### v0.68.3 — fix Beállítások page endless-refresh loop after a migration (2026-06-15)
Found while live-validating the M3 migration: once any data migration finished, the **Beállítások
(settings) page reloaded itself every ~1.5 s, forever**. The migration journal keeps returning the
last completed job indefinitely (`MigrationStatus` is not cleared on `done`); the page's resume-view
IIFE called `migWatch()` for *any* returned job, and `migWatch`'s `done` branch does
`setTimeout(location.reload, 1500)`. So every load saw the persisted `done` job → watched it →
reloaded → saw it again → looped endlessly.
Fix (settings.html): the resume-view now starts the watcher **only for an in-progress job**
(`phase !== 'done' && phase !== 'aborted'`). The one-time post-completion reload still fires from the
*active* watcher started by `storageMigrateAll`, so a real migration still refreshes drive state once
when it finishes — but a stale terminal job in the journal no longer triggers the loop. Template-only
change.
### v0.68.2 — fix stack-card state-badge clipping on unhealthy apps (CSS) (2026-06-15)
The `.stack-detail-header` is a `flex` / `space-between` row holding the `.stack-title-row` (logo +
@@ -390,8 +390,12 @@ function pollUntilBack() {
.then(function(r){return r.json();}).then(function(d){ if(d.ok){ migWatch(); } else { alert('Hiba: '+(d.error||'ismeretlen')); } })
.catch(function(e){ alert('Hiba: '+e); });
}
// Resume view: if a migration is already running when the page loads, show the panel.
(function(){ fetch('/api/storage/migrate/status').then(function(r){return r.json();}).then(function(d){ if(d.data&&d.data.job){ migWatch(); } }).catch(function(){}); })();
// Resume view: if a migration is STILL IN PROGRESS when the page loads, show the panel and watch.
// Must NOT re-watch a terminal (done/aborted) job: the journal keeps returning the last completed
// job indefinitely, and migWatch's done-branch reloads the page — so watching a persisted 'done'
// job on every load creates an endless refresh loop. Only the active watcher (started from
// storageMigrateAll) should fire the one-time post-completion reload.
(function(){ fetch('/api/storage/migrate/status').then(function(r){return r.json();}).then(function(d){ var job=d.data&&d.data.job; if(job && job.phase!=='done' && job.phase!=='aborted'){ migWatch(); } }).catch(function(){}); })();
</script>
{{else}}
<div class="empty-state" style="padding:1.5rem">