fix(sw): bump cache versions, add recipes to pre-cache, guard init IIFE
Resolves #72 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.22.1] - 2026-04-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- App no longer gets stuck on the "Oikos" splash screen when opened in a new tab. Two root causes addressed: (1) `sw.js` was not updated in v0.22.0, so the browser kept the old Service Worker and served stale cached files (old `router.js`, `meals.js`) via Stale-While-Revalidate — cache versions are now bumped (shell v35, pages v30) to force reinstallation and fresh file delivery. (2) A fatal error in `initI18n()` (e.g. locale fetch failure offline) left the splash screen visible forever — the router IIFE now catches such errors, hides the splash screen, and renders a recoverable error state.
|
||||||
|
- Service Worker now pre-caches `/pages/recipes.js` and `/styles/recipes.css` introduced in v0.22.0, enabling offline access to the Recipes page.
|
||||||
|
|
||||||
## [0.22.0] - 2026-04-21
|
## [0.22.0] - 2026-04-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "oikos",
|
"name": "oikos",
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "oikos",
|
"name": "oikos",
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypt": "^6.0.0",
|
"bcrypt": "^6.0.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "oikos",
|
"name": "oikos",
|
||||||
"version": "0.22.0",
|
"version": "0.22.1",
|
||||||
"description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.",
|
"description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.",
|
||||||
"main": "server/index.js",
|
"main": "server/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
+9
-2
@@ -858,8 +858,15 @@ if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
|
|||||||
// Initialisierung
|
// Initialisierung
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
(async () => {
|
(async () => {
|
||||||
await initI18n();
|
try {
|
||||||
navigate(location.pathname, false);
|
await initI18n();
|
||||||
|
navigate(location.pathname, false);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('[Router] Initialisierung fehlgeschlagen:', err);
|
||||||
|
const loading = document.getElementById('app-loading');
|
||||||
|
if (loading) loading.hidden = true;
|
||||||
|
renderError(document.getElementById('app'), err);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Globale Exporte
|
// Globale Exporte
|
||||||
|
|||||||
+4
-2
@@ -12,8 +12,8 @@
|
|||||||
* API: Immer Netzwerk (kein Caching von Nutzerdaten)
|
* API: Immer Netzwerk (kein Caching von Nutzerdaten)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const SHELL_CACHE = 'oikos-shell-v34';
|
const SHELL_CACHE = 'oikos-shell-v35';
|
||||||
const PAGES_CACHE = 'oikos-pages-v29';
|
const PAGES_CACHE = 'oikos-pages-v30';
|
||||||
const ASSETS_CACHE = 'oikos-assets-v27';
|
const ASSETS_CACHE = 'oikos-assets-v27';
|
||||||
const ALL_CACHES = [SHELL_CACHE, PAGES_CACHE, ASSETS_CACHE];
|
const ALL_CACHES = [SHELL_CACHE, PAGES_CACHE, ASSETS_CACHE];
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ const APP_SHELL = [
|
|||||||
'/styles/contacts.css',
|
'/styles/contacts.css',
|
||||||
'/styles/budget.css',
|
'/styles/budget.css',
|
||||||
'/styles/settings.css',
|
'/styles/settings.css',
|
||||||
|
'/styles/recipes.css',
|
||||||
'/components/oikos-install-prompt.js',
|
'/components/oikos-install-prompt.js',
|
||||||
'/offline.html',
|
'/offline.html',
|
||||||
'/manifest.json',
|
'/manifest.json',
|
||||||
@@ -74,6 +75,7 @@ const PAGE_MODULES = [
|
|||||||
'/pages/budget.js',
|
'/pages/budget.js',
|
||||||
'/pages/settings.js',
|
'/pages/settings.js',
|
||||||
'/pages/login.js',
|
'/pages/login.js',
|
||||||
|
'/pages/recipes.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user