After an Immich upgrade, Svelte chunk filenames rotate but the cached
PWA shell still imports old ones — dynamic imports 500 or 404. Our
auto-update mechanism only caught changes to our injected script, not
upstream changes, so the stuck PWA never self-healed.
Now /api/custom/inject-version returns a hash of
(custom script || Immich chunk manifest fingerprint), so any upgrade
bumps the version, the PWA detects it on next poll, unregisters the
service worker, clears caches, and reloads with fresh chunks.
We extract only the /_app/immutable/... references from the HTML to
avoid hashing server-rendered per-user state (CSRF tokens etc) that
would cause spurious version churn.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>