diff --git a/app/sovran_systemsos_web/server.py b/app/sovran_systemsos_web/server.py index 58d88c2..9695032 100644 --- a/app/sovran_systemsos_web/server.py +++ b/app/sovran_systemsos_web/server.py @@ -950,6 +950,12 @@ async def api_features_toggle(req: FeatureToggleRequest): await loop.run_in_executor(None, _write_hub_overrides, features, nostr_npub) + # Clear the old rebuild log so the frontend doesn't pick up stale results + try: + open(REBUILD_LOG, "w").close() + except OSError: + pass + # Start the rebuild service await asyncio.create_subprocess_exec( "systemctl", "reset-failed", REBUILD_UNIT, diff --git a/app/sovran_systemsos_web/static/app.js b/app/sovran_systemsos_web/static/app.js index ddcd132..d3d93ef 100644 --- a/app/sovran_systemsos_web/static/app.js +++ b/app/sovran_systemsos_web/static/app.js @@ -543,7 +543,8 @@ function openRebuildModal() { if ($rebuildSave) $rebuildSave.style.display = "none"; if ($rebuildClose) $rebuildClose.disabled = true; $rebuildModal.classList.add("open"); - startRebuildPoll(); + // Delay first poll slightly to let the rebuild service start and clear stale log + setTimeout(startRebuildPoll, 1500); } function closeRebuildModal() {