Offline navigations to /%61uth/login or /%61pi/v1/settings/household
missed the reserved prefixes and were answered with the precached
index.html. routeFor now percent-decodes the pathname and checks reserved
prefixes before and after dot segments are resolved, as the server does;
a malformed encoding is network-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the font route ahead of precacheAndRoute so a font fetch uses
CacheFirst with its ExpirationPlugin instead of being answered by the
precache route. Fonts stay in the precache manifest; when the network
fails and the runtime cache has no copy, the font comes from the
precache. Source tests pin the expiration plugin, the precache fallback
and the route order.
Read the injected precache list in the production-build test as JSON
and assert the index.html entry's revision there, so it no longer
depends on matching the minified sw.js with a regex.
Maestro task: 8fa0d0bd-4a52-4f09-ba68-41bdbdfda63b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Precache the shell, JS, CSS and self-hosted fonts in
mealquest-precache-v1. Route every other request through the pure
src/sw/routes.ts decision: NetworkFirst (3 s timeout) for plans,
shopping, dinners and home; CacheFirst with expiration for /media/* and
font files; NetworkOnly for /auth/*, settings, jobs and every non-GET.
App navigations fall back to the precached index.html offline. On
activate, delete only stale caches named mealquest-*.
Maestro task: 8fa0d0bd-4a52-4f09-ba68-41bdbdfda63b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>