From 25417364d2b9a67053a5604541c248d866f3d8a7 Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 10 May 2026 09:04:12 +0200 Subject: [PATCH] Fix: kein zweiter SW-Reload nach force-update (by_skip_sw_reload Flag), Tagebuch bleibt offen (SW by-v819) --- backend/main.py | 4 +++- backend/static/index.html | 19 ++++++++++++------- backend/static/js/app.js | 2 +- backend/static/sw.js | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/backend/main.py b/backend/main.py index 2dc1259..c014419 100644 --- a/backend/main.py +++ b/backend/main.py @@ -341,7 +341,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "818" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "819" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): @@ -1624,6 +1624,8 @@ p{color:#94a3b8;font-size:14px}
⏳ Aktualisiere Ban Yaro…

Service Worker wird entfernt…

- - - + + + @@ -583,10 +583,10 @@ - - - - + + + + @@ -637,6 +637,11 @@ if (!sw) return; sw.addEventListener('statechange', () => { if (sw.state === 'activated') { + // Kein zweiter Reload nach force-update + if (sessionStorage.getItem('by_skip_sw_reload')) { + sessionStorage.removeItem('by_skip_sw_reload'); + return; + } window.location.replace('/?_t=' + Date.now()); } }); diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 02d31ea..11ea5b8 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '818'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '819'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen diff --git a/backend/static/sw.js b/backend/static/sw.js index 78b89b4..ef119bd 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v818'; +const CACHE_VERSION = 'by-v819'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache