mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
A measurement added in-app left the dashboard hero, score ring and tile strip showing yesterday's value until a hard reload. The snapshot query carries refetch-on-mount/focus off and a 120 s poll, but the measurement mutation bundle never invalidated the snapshot key, so an in-app create / update / delete updated every other surface and left the Startseite stale. Add the snapshot key to the measurement-dependent bundle, mirroring the medication fix; the manual routes already hard-evict the server snapshot bucket, so the triggered refetch returns post-write data at once. Background syncs (Withings, Apple Health, iOS batch) fire no client mutation event, so the keys were never invalidated and the dashboard only caught up on the 120 s poll or a reload. Refetch the snapshot on window focus so returning to the tab after a sync surfaces the new readings; the 60 s staleTime keeps rapid focus toggles free and the warm server cache keeps the focus refetch cheap.