release: v0.13.2 — PWA cache fix so mobile gets the v0.13.x modal
Mobile operators were never seeing the inline PDF preview, .TXT download, or Review form that v0.13.0 added — every feature was working on desktop browsers but invisible in the PWA. Root cause: backend/static/sw.js had CACHE_VERSION = 'v1', unchanged since v0.12.x. The activate handler deletes any cache not matching CACHE_VERSION, so without a bump the stale sfm-static-v1 cache (with the pre-v0.13.0 event-modal.js) stayed authoritative. cacheFirst strategy served it forever; mobile users effectively saw the v0.12.x modal regardless of how many times we rebuilt the image. Fix: - CACHE_VERSION bumped to 'v0.13.2' (matches backend/main.py VERSION). Comment in sw.js documents the convention: any release touching a static asset must bump this string. - event-modal.js added to the precache list so its lifecycle is explicitly tied to the SW version bump (installed fresh on activate rather than landing via the cacheFirst-then-cached pattern). Mobile users get the new modal on next page nav: SW update check picks up the bumped sw.js, skipWaiting installs it, activate evicts the v1 caches, controllerchange fires, page reloads, fresh event-modal.js loads. Worst case ~1h delay from registration.update() interval; operators can force-refresh by closing + reopening the PWA. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,21 @@ All notable changes to Terra-View will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.13.2] - 2026-05-30
|
||||||
|
|
||||||
|
PWA-cache fix for mobile operators. v0.13.0 added the inline PDF preview, `.TXT` download, and Review form to `event-modal.js`, but mobile devices using Terra-View as a PWA never saw any of it — the service worker had `CACHE_VERSION = 'v1'` (unchanged since v0.12.x), so the activate handler never evicted the stale cache and mobile users kept getting served the pre-v0.13.0 modal forever.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Service worker cache version bumped + tied to the app version**. `CACHE_VERSION` in `backend/static/sw.js` is now `'v0.13.2'`, which causes the SW's activate handler to delete the old `sfm-static-v1` / `sfm-dynamic-v1` / `sfm-data-v1` caches on first visit after the upgrade. Going forward the convention is: any release that touches a static asset must bump `CACHE_VERSION` to match `backend/main.py`'s `VERSION`. Comment in `sw.js` documents this.
|
||||||
|
- **`event-modal.js` precached** alongside `mobile.js` / `offline-db.js` etc. Lifecycle is now tied to the SW version bump explicitly — old modal JS gets evicted on activate, new modal JS is fetched and cached during install.
|
||||||
|
|
||||||
|
### What mobile users will see after deploy
|
||||||
|
|
||||||
|
On next page navigation the SW update check fires, the new SW installs (skipWaiting), activate evicts the v1 caches, `controllerchange` fires, the page reloads with the v0.13.x modal. On the worst-case device (no recent visit), it might take up to an hour for `registration.update()` to pick up the new SW — operators can force-refresh by closing and re-opening the PWA, or by clearing site data once.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [0.13.1] - 2026-05-29
|
## [0.13.1] - 2026-05-29
|
||||||
|
|
||||||
Same-day patch on top of v0.13.0. Fixes the mic-chart unit default — v0.13.0 shipped with `dBL` as the default, but the PDF report renders the mic axis in psi, so the website chart and the printed report didn't match. Operator caught it within an hour of rollout. Also relabels the modal's "Captured at" field to "Time received" so it isn't mistaken for the device's trigger time.
|
Same-day patch on top of v0.13.0. Fixes the mic-chart unit default — v0.13.0 shipped with `dBL` as the default, but the PDF report renders the mic axis in psi, so the website chart and the printed report didn't match. Operator caught it within an hour of rollout. Also relabels the modal's "Captured at" field to "Time received" so it isn't mistaken for the device's trigger time.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Terra-View v0.13.1
|
# Terra-View v0.13.2
|
||||||
Backend API and HTMX-powered web interface for managing a mixed fleet of seismographs and field modems. Track deployments, monitor health in real time, merge roster intent with incoming telemetry, and control your fleet through a unified database and dashboard.
|
Backend API and HTMX-powered web interface for managing a mixed fleet of seismographs and field modems. Track deployments, monitor health in real time, merge roster intent with incoming telemetry, and control your fleet through a unified database and dashboard.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ Base.metadata.create_all(bind=engine)
|
|||||||
ENVIRONMENT = os.getenv("ENVIRONMENT", "production")
|
ENVIRONMENT = os.getenv("ENVIRONMENT", "production")
|
||||||
|
|
||||||
# Initialize FastAPI app
|
# Initialize FastAPI app
|
||||||
VERSION = "0.13.1"
|
VERSION = "0.13.2"
|
||||||
if ENVIRONMENT == "development":
|
if ENVIRONMENT == "development":
|
||||||
_build = os.getenv("BUILD_NUMBER", "0")
|
_build = os.getenv("BUILD_NUMBER", "0")
|
||||||
if _build and _build != "0":
|
if _build and _build != "0":
|
||||||
|
|||||||
+11
-2
@@ -1,18 +1,27 @@
|
|||||||
/* Service Worker for Seismo Fleet Manager PWA */
|
/* Service Worker for Seismo Fleet Manager PWA */
|
||||||
/* Network-first strategy with cache fallback for real-time data */
|
/* Network-first strategy with cache fallback for real-time data */
|
||||||
|
|
||||||
const CACHE_VERSION = 'v1';
|
// IMPORTANT: bump this on every release that touches a precached or
|
||||||
|
// runtime-cached static asset (event-modal.js, mobile.js, style.css,
|
||||||
|
// templates served at /, etc.). The activate handler deletes any cache
|
||||||
|
// not matching CACHE_VERSION, so old SW caches get evicted and mobile
|
||||||
|
// PWA users actually receive the new bundles instead of being stuck on
|
||||||
|
// the pre-bump version. Convention: keep it in sync with the Terra-View
|
||||||
|
// version string in backend/main.py.
|
||||||
|
const CACHE_VERSION = 'v0.13.2';
|
||||||
const STATIC_CACHE = `sfm-static-${CACHE_VERSION}`;
|
const STATIC_CACHE = `sfm-static-${CACHE_VERSION}`;
|
||||||
const DYNAMIC_CACHE = `sfm-dynamic-${CACHE_VERSION}`;
|
const DYNAMIC_CACHE = `sfm-dynamic-${CACHE_VERSION}`;
|
||||||
const DATA_CACHE = `sfm-data-${CACHE_VERSION}`;
|
const DATA_CACHE = `sfm-data-${CACHE_VERSION}`;
|
||||||
|
|
||||||
// Files to precache (critical app shell)
|
// Files to precache (critical app shell). event-modal.js is included
|
||||||
|
// so its cache lifecycle is tied to the SW version bump explicitly.
|
||||||
const STATIC_FILES = [
|
const STATIC_FILES = [
|
||||||
'/',
|
'/',
|
||||||
'/static/style.css',
|
'/static/style.css',
|
||||||
'/static/mobile.css',
|
'/static/mobile.css',
|
||||||
'/static/mobile.js',
|
'/static/mobile.js',
|
||||||
'/static/offline-db.js',
|
'/static/offline-db.js',
|
||||||
|
'/static/event-modal.js',
|
||||||
'/static/manifest.json',
|
'/static/manifest.json',
|
||||||
'https://cdn.tailwindcss.com',
|
'https://cdn.tailwindcss.com',
|
||||||
'https://unpkg.com/htmx.org@1.9.10',
|
'https://unpkg.com/htmx.org@1.9.10',
|
||||||
|
|||||||
Reference in New Issue
Block a user