diff --git a/backend/main.py b/backend/main.py index 6bb7070..e02d63d 100644 --- a/backend/main.py +++ b/backend/main.py @@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "886" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "887" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/index.html b/backend/static/index.html index cc215cf..557467a 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -637,11 +637,8 @@ 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; - } + // Flag nur prüfen, nicht konsumieren — controllerchange konsumiert ihn + if (sessionStorage.getItem('by_skip_sw_reload')) return; window.location.replace('/?_t=' + Date.now()); } }); @@ -663,7 +660,12 @@ }); // Backup: controllerchange (falls updatefound nicht feuert) + // Konsumiert auch den by_skip_sw_reload-Flag (statechange prüft ihn nur) navigator.serviceWorker.addEventListener('controllerchange', () => { + 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 987ac82..fc381d6 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 = '886'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '887'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.1'; // ← 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 61187c5..501b993 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-v886'; +const CACHE_VERSION = 'by-v887'; 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