Sweep: r.ok-Check bei allen direkten fetch('/api/...')-Aufrufen (SW-503-JSON-Falle)
5 Fundstellen nach dem Marker-Bug-Muster (v1224) gefixt:
- landing-init.js: Stats-Zahlen waeren offline NaN geworden
- social.js: Medien-Upload-Fehler wurde verschluckt (kein ok-Check, kein catch)
- routes.js: Unterwegs-POIs — {detail:...}.filter warf statt sauber []
- map.js: Marker-Melden zeigte Erfolgs-Toast obwohl Request fehlschlug
- settings.js: Update-Check meldete offline faelschlich 'ist aktuell'
Rest geprueft: api.js-Wrapper, wiki/uebungen/trainingsplaene-Helper checken ok,
externe Dienste (Nominatim etc.) laufen nicht ueber den SW-/api/-Zweig.
Bump v1225
This commit is contained in:
parent
e6d6a3e697
commit
45534aa8ee
10 changed files with 35 additions and 20 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
1224
|
||||
1225
|
||||
|
|
@ -86,14 +86,14 @@
|
|||
<title>Ban Yaro</title>
|
||||
|
||||
<!-- Theme + theme-color Statusleiste vor CSS setzen -->
|
||||
<script src="/js/boot-early.js?v=1224"></script>
|
||||
<script src="/js/boot-early.js?v=1225"></script>
|
||||
|
||||
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=1224">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=1224">
|
||||
<link rel="stylesheet" href="/css/components.css?v=1224">
|
||||
<link rel="stylesheet" href="/css/utilities.css?v=1224">
|
||||
<link rel="stylesheet" href="/css/lists.css?v=1224">
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=1225">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=1225">
|
||||
<link rel="stylesheet" href="/css/components.css?v=1225">
|
||||
<link rel="stylesheet" href="/css/utilities.css?v=1225">
|
||||
<link rel="stylesheet" href="/css/lists.css?v=1225">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
@ -612,11 +612,11 @@
|
|||
<div id="modal-container"></div>
|
||||
|
||||
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
||||
<script src="/js/api.js?v=1224"></script>
|
||||
<script src="/js/ui.js?v=1224"></script>
|
||||
<script src="/js/app.js?v=1224"></script>
|
||||
<script src="/js/worlds.js?v=1224"></script>
|
||||
<script src="/js/offline-indicator.js?v=1224"></script>
|
||||
<script src="/js/api.js?v=1225"></script>
|
||||
<script src="/js/ui.js?v=1225"></script>
|
||||
<script src="/js/app.js?v=1225"></script>
|
||||
<script src="/js/worlds.js?v=1225"></script>
|
||||
<script src="/js/offline-indicator.js?v=1225"></script>
|
||||
|
||||
<!-- Feature-Seiten werden lazy geladen -->
|
||||
|
||||
|
|
@ -626,7 +626,7 @@
|
|||
|
||||
|
||||
<!-- Boot: Offline-Banner + SW-Registration (extrahiert für CSP) -->
|
||||
<script src="/js/boot.js?v=1224"></script>
|
||||
<script src="/js/boot.js?v=1225"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '1224'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '1225'; // ← 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;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
// Live-Zahlen
|
||||
var fmt = new Intl.NumberFormat('de-DE');
|
||||
fetch('/api/stats/public')
|
||||
.then(function(r) { return r.json(); })
|
||||
// r.ok prüfen: der SW antwortet offline mit 503+JSON ({detail:…}) → json() wirft nicht
|
||||
.then(function(r) { if (!r.ok) throw new Error('stats ' + r.status); return r.json(); })
|
||||
.then(function(d) {
|
||||
function set(id, val) {
|
||||
var el = document.getElementById(id);
|
||||
|
|
|
|||
|
|
@ -1865,6 +1865,9 @@ window.Page_map = (() => {
|
|||
credentials: 'include', body: JSON.stringify(body),
|
||||
});
|
||||
if (res.status === 401) { UI.toast.error('Bitte erst anmelden.'); return; }
|
||||
// res.ok prüfen: SW antwortet offline mit 503+JSON → json() wirft nicht,
|
||||
// sonst Erfolgs-Toast obwohl nichts gemeldet wurde. (202 = offline gequeued = ok.)
|
||||
if (!res.ok) throw new Error(`report ${res.status}`);
|
||||
const data = await res.json();
|
||||
if (data.status === 'bereits_gemeldet') {
|
||||
UI.toast.info('Du hast diesen Marker bereits gemeldet.');
|
||||
|
|
|
|||
|
|
@ -2762,8 +2762,11 @@ window.Page_routes = (() => {
|
|||
await Promise.all(NEARBY_TYPES.map(async ({ type, icon, label, svgIcon, color }) => {
|
||||
try {
|
||||
const params = new URLSearchParams({ type, fast: 'true', ...bbox });
|
||||
const pois = await fetch(`/api/osm/pois?${params}`).then(r => r.json());
|
||||
pois
|
||||
// r.ok prüfen: SW antwortet offline mit 503+JSON ({detail:…}) → json() wirft nicht
|
||||
const r = await fetch(`/api/osm/pois?${params}`);
|
||||
if (!r.ok) throw new Error(`pois ${r.status}`);
|
||||
const pois = await r.json();
|
||||
(Array.isArray(pois) ? pois : [])
|
||||
.filter(p => _isNearTrack(p, track, 100)) // max 100m vom Track-Verlauf
|
||||
.forEach(p => results.push({ ...p, _icon: icon, _label: label, _svgIcon: svgIcon, _color: color }));
|
||||
} catch {}
|
||||
|
|
|
|||
|
|
@ -1346,6 +1346,9 @@ window.Page_settings = (() => {
|
|||
try {
|
||||
// Versionsnummer direkt vom API-Endpunkt holen
|
||||
const r = await fetch('/api/version', { cache: 'no-store' });
|
||||
// r.ok prüfen: SW antwortet offline mit 503+JSON → json() wirft nicht und
|
||||
// serverVersion=undefined meldete fälschlich „Ban Yaro ist aktuell".
|
||||
if (!r.ok) throw new Error(`version ${r.status}`);
|
||||
const { version: serverVersion } = await r.json();
|
||||
const localVersion = typeof APP_VER !== 'undefined' ? APP_VER : '0';
|
||||
|
||||
|
|
|
|||
|
|
@ -377,7 +377,12 @@ window.Page_social = (() => {
|
|||
method: 'POST',
|
||||
headers: {Authorization: `Bearer ${localStorage.getItem('by_token')}`},
|
||||
body: fd,
|
||||
}).then(r => r.json()).then(d => { uploadedMediaUrl = d.url; });
|
||||
}).then(r => {
|
||||
// r.ok prüfen: SW antwortet offline mit 503+JSON → json() wirft nicht, d.url wäre undefined
|
||||
if (!r.ok) throw new Error(`upload ${r.status}`);
|
||||
return r.json();
|
||||
}).then(d => { uploadedMediaUrl = d.url; })
|
||||
.catch(() => UI.toast.error('Medien-Upload fehlgeschlagen.'));
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<script src="/js/landing-init.js?v=1224"></script>
|
||||
<script src="/js/landing-init.js?v=1225"></script>
|
||||
<title>Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz</title>
|
||||
<meta name="description" content="Ban Yaro: Die kostenlose All-in-One Hunde-App für DACH. Tagebuch, Giftköder-Alarm, Training mit KI, Forum, Wurfbörse, Stammbaum, Inzucht-Check — DSGVO-konform, offline-fähig, ohne App Store.">
|
||||
<meta name="keywords" content="Hunde App, Hunde Community, Wurfbörse, Züchter, Welpen kaufen, Stammbaum Hund, Inzuchtkoeffizient, Hundezucht, Impfpass Hund, Giftköder Alarm, Gassi Community, Hundetraining App, Hunde Forum, Hunde KI, Hundefilm Datenbank, Welpen Marktplatz">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
============================================================ */
|
||||
|
||||
// ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab
|
||||
const VER = '1224';
|
||||
const VER = '1225';
|
||||
const CACHE_VERSION = `by-v${VER}`;
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue