From 6af08ab5431cff0bb1092bab0a8c11ac82e66765 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 6 Jun 2026 11:27:31 +0200 Subject: [PATCH 1/2] Offline-Plan: Geraetetest bestanden, Befunde (Marker offline, Banner) dokumentiert --- docs/OFFLINE_MAPS_PLAN.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/OFFLINE_MAPS_PLAN.md b/docs/OFFLINE_MAPS_PLAN.md index 3fafa26..6e6dc76 100644 --- a/docs/OFFLINE_MAPS_PLAN.md +++ b/docs/OFFLINE_MAPS_PLAN.md @@ -29,9 +29,18 @@ - **Raster-Prefetch gegated:** `offline-indicator.js init()` überspringt `_prefetchTiles()` im Offline-Tiles-Modus (GL nutzt das OSM-Raster nicht). +**✅ Gerätetest-Befunde behoben (2026-06-06, v1223) — Gerätetest iOS BESTANDEN (Basemap+Labels offline ok):** +- **POI-Marker offline:** `downloadAround` speichert zusätzlich `/api/osm/pois` (fast=true, liest lokale + osm_pois-DB) je Typ für die Region-Bbox in IndexedDB (Key-Präfix `p/`, Merge per id — zweite + Region löscht die erste nicht). `MapOffline.pois(type, bbox)` filtert für den Ausschnitt; map.js + Phase-1-Catch fällt offline darauf zurück. POI-Typen-Liste in map-offline.js synchron mit + `OSM_LAYER_MAP` (pages/map.js) halten! Marker erscheinen erst nach ERNEUTEM Region-Download. +- **Offline-Banner** klappt 5 s nach Offline-Gang auf schmale Icon-Leiste ein (volles Banner verdeckte + die Karten-Legende); Banner-Styles von index.html-Inline nach components.css konsolidiert. + **🔲 Offen (Follow-ups Runde 2):** -- **Gerätetest (iOS-PWA offline/IndexedDB)** auf Staging — jetzt ohne Flag-Frickelei möglich (Default AN). - Danach: Prod-Freigabe-Entscheidung (Default-Hostnames erweitern analog `by_map_gl`). +- **Gerätetest-Nachtest** (Marker offline + Banner-Einklappen, v1223) → dann Prod-Freigabe-Entscheidung + (Default-Hostnames erweitern analog `by_map_gl`). - **Adaptives Lernen** (rollendes Vorausladen beim Aufzeichnen + Funkloch-Gedächtnis). - **Bereichsauswahl / Routen-Korridor** (inkl. „Route offline speichern" aus routes.js `_openDetail`). - Alten OSM-Raster-Prefetch (`offline-indicator.js _prefetchTiles` + `map.js _cacheTiles`) komplett From e6d6a3e697f66ee30935cefc8ce79856300a1b53 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 6 Jun 2026 11:35:03 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20Marker=20verschwanden=20offline=20be?= =?UTF-8?q?im=20Kartenbewegen=20=E2=80=94=20SW-503-JSON=20als=20Fehler=20w?= =?UTF-8?q?erten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der SW beantwortet nicht-cachebare API-GETs offline mit 503 + JSON-Body, r.json() wirft dann NICHT -> Erfolgs-Pfad ersetzte Marker durch {detail:...}. _fetchPois prueft jetzt r.ok + Array.isArray, dadurch greift der IndexedDB-Fallback (MapOffline.pois) in Phase 1 und Phase 2 behaelt den Bestand. Bump v1224 --- VERSION | 2 +- backend/static/index.html | 24 ++++++++++++------------ backend/static/js/app.js | 2 +- backend/static/js/pages/map.js | 14 ++++++++++++-- backend/static/landing.html | 2 +- backend/static/sw.js | 2 +- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/VERSION b/VERSION index de697b5..7aee5ac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1223 \ No newline at end of file +1224 \ No newline at end of file diff --git a/backend/static/index.html b/backend/static/index.html index 1663fcf..bfd8dd9 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -86,14 +86,14 @@ Ban Yaro - + - - - - - + + + + + @@ -612,11 +612,11 @@ - - - - - + + + + + @@ -626,7 +626,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index c47d15f..204d3f4 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 = '1223'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1224'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator) window.APP_VERSION = APP_VERSION; diff --git a/backend/static/js/pages/map.js b/backend/static/js/pages/map.js index dd159d0..2692cff 100644 --- a/backend/static/js/pages/map.js +++ b/backend/static/js/pages/map.js @@ -1469,12 +1469,22 @@ window.Page_map = (() => { } } + // POIs holen — WICHTIG: r.ok prüfen! Der SW antwortet offline auf nicht-cachebare + // API-GETs mit 503 + JSON-Body ({detail:…}) → r.json() wirft NICHT, der Erfolgs-Pfad + // liefe mit einem Objekt statt Array weiter und ersetzte die Marker durch nichts. + const _fetchPois = async (params) => { + const r = await fetch(`/api/osm/pois?${params}`); + if (!r.ok) throw new Error(`pois ${r.status}`); + const pois = await r.json(); + return Array.isArray(pois) ? pois : []; + }; + // Phase 1: sofort DB-Daten zeigen (fast=true) _setOsmStatus('Lade…'); const fastTasks = activeLayers.map(async ([layerKey, osmType]) => { const params = new URLSearchParams({ type: osmType, fast: 'true', ...bbox }); try { - const pois = await fetch(`/api/osm/pois?${params}`).then(r => r.json()); + const pois = await _fetchPois(params); _replaceOsmMarkers(layerKey, pois); return pois.length; } catch { @@ -1499,7 +1509,7 @@ window.Page_map = (() => { const freshTasks = activeLayers.map(async ([layerKey, osmType]) => { const params = new URLSearchParams({ type: osmType, ...bbox }); try { - const pois = await fetch(`/api/osm/pois?${params}`).then(r => r.json()); + const pois = await _fetchPois(params); const osmCount = _osmCountOf(layerKey); if (pois.length !== osmCount) _replaceOsmMarkers(layerKey, pois); _done++; diff --git a/backend/static/landing.html b/backend/static/landing.html index dc2f09a..9b7b061 100644 --- a/backend/static/landing.html +++ b/backend/static/landing.html @@ -4,7 +4,7 @@ - + Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz diff --git a/backend/static/sw.js b/backend/static/sw.js index ab823c7..8c51cc9 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -4,7 +4,7 @@ ============================================================ */ // ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab -const VER = '1223'; +const VER = '1224'; const CACHE_VERSION = `by-v${VER}`; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten