From 82cdd5c579d8af62de5d3ae5dff6bb273647b567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 20 Jun 2026 13:01:05 +0200 Subject: [PATCH] docs: correct dashboard-snapshot server cache TTL comment The hook comment said the server SWR cache is warm for 60 s, but the snapshot key's fresh TTL is DASHBOARD_REFETCH_INTERVAL_MS + 60_000 (~180 s). Correct both references. --- src/lib/queries/use-dashboard-snapshot.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/queries/use-dashboard-snapshot.ts b/src/lib/queries/use-dashboard-snapshot.ts index 77c8e093d..0c34da32e 100644 --- a/src/lib/queries/use-dashboard-snapshot.ts +++ b/src/lib/queries/use-dashboard-snapshot.ts @@ -24,11 +24,12 @@ * returning to the tab after a sync surfaces the new readings within * a frame. The `staleTime: 60_000` gate makes rapid focus toggles * cheap (a refetch fires only once the slot is stale), and the warm - * 60 s server SWR cache keeps the focus refetch sub-cost. + * server SWR cache (~180 s fresh TTL, `DASHBOARD_REFETCH_INTERVAL_MS + * + 60_000`) keeps the focus refetch sub-cost. * - `refetchInterval: 120_000` + `refetchIntervalInBackground: false` * keep an open dashboard live: an idle tab polls the snapshot every * two minutes so freshly-synced Withings / HealthKit readings appear - * without a manual reload. The poll hits the warm 60 s server cache + * without a manual reload. The poll hits the warm ~180 s server cache * cheaply and only triggers a sub-second rollup rebuild when the * underlying data actually changed — never the LLM surfaces, which * stay daily / pre-generated. The interval pauses while the tab is