fix(pwa): serve the manifest network-first so changed app colours reach the browser
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m24s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m24s
chore(release): v0.14.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
61541b2851
commit
08ae91fcdb
4 files changed
+27
-6
No files matched your search
+7
-1
@@ -6,6 +6,11 @@ Das Format folgt [Keep a Changelog](https://keepachangelog.com/de/1.1.0/), die V
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.14.2] - 2026-10-31
|
||||
|
||||
### Fixed
|
||||
- Installierte App: Der Service Worker lieferte `manifest.json` zuerst aus dem Cache, sodass der Browser bei der Prüfung auf geänderte App-Farben noch die alte blaue Fassung sah. Das Manifest kommt jetzt immer frisch vom Server (Cache nur offline); die App-Caches werden einmal erneuert.
|
||||
|
||||
## [0.14.1] - 2026-10-30
|
||||
|
||||
### Fixed
|
||||
@@ -340,7 +345,8 @@ Das Format folgt [Keep a Changelog](https://keepachangelog.com/de/1.1.0/), die V
|
||||
- Geteilte Listen (Einkaufs-, Pack- und Checklisten) mit `#Kategorie`-Gruppierung, Mengenangaben und Echtzeit-Abhaken.
|
||||
- Benutzer-, Gruppen- und Admin-Verwaltung (Ersteinrichtungs-Assistent, Einladungscodes, Profilbilder, persönliche API-Keys & Webhook-Ingest `/api/v1/webhooks/ingest`, JSON-Datenexport) sowie CSS-Theme-Engine mit 4 Themes (`Dark`, `Light`, `High Contrast`, `Soft`) und PWA-Unterstützung.
|
||||
|
||||
[Unreleased]: https://git.dsit.me/sandrodach/MindSift/compare/v0.14.1...dev
|
||||
[Unreleased]: https://git.dsit.me/sandrodach/MindSift/compare/v0.14.2...dev
|
||||
[0.14.2]: https://git.dsit.me/sandrodach/MindSift/compare/v0.14.1...v0.14.2
|
||||
[0.14.1]: https://git.dsit.me/sandrodach/MindSift/compare/v0.14.0...v0.14.1
|
||||
[0.14.0]: https://git.dsit.me/sandrodach/MindSift/compare/v0.13.0...v0.14.0
|
||||
[0.13.0]: https://git.dsit.me/sandrodach/MindSift/compare/v0.12.2...v0.13.0
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mindsift-frontend",
|
||||
"version": "0.14.1",
|
||||
"version": "0.14.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mindsift-frontend",
|
||||
"version": "0.14.1",
|
||||
"version": "0.14.2",
|
||||
"license": "Unlicense",
|
||||
"dependencies": {
|
||||
"@fontsource-variable/inter": "5.3.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "mindsift-frontend",
|
||||
"private": true,
|
||||
"version": "0.14.1",
|
||||
"version": "0.14.2",
|
||||
"license": "Unlicense",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
+17
-2
@@ -2,10 +2,12 @@
|
||||
// - Page loads (navigation): network first, so a new release is picked up right away; offline the
|
||||
// last loaded index.html is used.
|
||||
// - Built bundles (/assets/*, file names contain a content hash): from the cache, loaded once.
|
||||
// - Icons and manifest: from the cache, refreshed in the background.
|
||||
// - Icons: from the cache, refreshed in the background.
|
||||
// - Manifest: network first (the browser checks it for changed app colours and name; a cached copy
|
||||
// would hand it the old values), the cache only offline.
|
||||
// - API requests are never touched; offline data comes from the app's own cache (lib/offline.ts).
|
||||
// Raise VERSION when this file changes in a way that needs fresh caches.
|
||||
const VERSION = 'v3';
|
||||
const VERSION = 'v4';
|
||||
const SHELL_CACHE = `mindsift-shell-${VERSION}`;
|
||||
const ASSET_CACHE = `mindsift-assets-${VERSION}`;
|
||||
const MAX_ASSETS = 80;
|
||||
@@ -70,6 +72,17 @@ async function cacheFirstAsset(request) {
|
||||
return response;
|
||||
}
|
||||
|
||||
async function networkFirstShell(request) {
|
||||
const cache = await caches.open(SHELL_CACHE);
|
||||
try {
|
||||
const response = await fetch(request, { cache: 'no-store' });
|
||||
if (response.ok && response.type === 'basic') cache.put(request, response.clone());
|
||||
return response;
|
||||
} catch {
|
||||
return (await cache.match(request)) || Response.error();
|
||||
}
|
||||
}
|
||||
|
||||
async function staleWhileRevalidate(request) {
|
||||
const cache = await caches.open(SHELL_CACHE);
|
||||
const hit = await cache.match(request);
|
||||
@@ -162,6 +175,8 @@ self.addEventListener('fetch', (event) => {
|
||||
event.respondWith(networkFirstPage(request));
|
||||
} else if (url.pathname.startsWith('/assets/')) {
|
||||
event.respondWith(cacheFirstAsset(request));
|
||||
} else if (url.pathname === '/manifest.json') {
|
||||
event.respondWith(networkFirstShell(request));
|
||||
} else if (SHELL_URLS.includes(url.pathname)) {
|
||||
event.respondWith(staleWhileRevalidate(request));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user