fix/spa-reconnect-no-demo-data #1

Merged
Erik merged 2 commits from fix/spa-reconnect-no-demo-data into main 2026-07-09 10:56:18 +00:00

2 Commits

Author SHA1 Message Date
3d52e0b79e perf(db): serve presses + downtime-reason texts from the shared reference cache
press_settings.presses and settings.downtime_reasons are re-read on every 12s
overview poll; route them through the kernel cached_select() TTL cache so they
stop consuming a shared-pool checkout each poll. Part of the gateway
connection-pool-saturation fix (see fastAPI/agent_docs/db-pool-relief.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 12:06:40 +02:00
360b049af9 fix(spa): reconnect spinner on connection loss, no demo data in prod
On a failed fetch the store now keeps the last real payload (stale > fake)
and flags `disconnected` instead of overwriting live data with bundled demo
data. Sample fallback is gated behind import.meta.env.DEV, so `vite build`
tree-shakes it out entirely (verified: no sample strings in dist).

- cold start / no data: centered reconnect spinner that keeps retrying
- data present + drop: stale data stays, header shows amber "reconnecting"
- polling retries faster (4s) while disconnected, recovers automatically
- sample.ts data moved into sampleOverview() so the module fully tree-shakes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 09:20:20 +02:00