mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
GET /api/dashboard/summary builds its own payload instead of going through readDashboardSnapshotCached, so it never picked up the module gate the shared snapshot builder applies. It emitted glucose and sleep cards on data presence alone while /api/dashboard/snapshot correctly withheld them for the same account. Lift the drop decision out of gateSummariesByModules into disabledSummaryTypes in the client-safe widget-modules module, so the two dashboard aggregates decide from one map. The snapshot keys its summaries by MeasurementType and the summary route emits cards keyed by an iOS MetricKind, so what is shared is the decision, not the filtering; SUMMARY_METRIC_TYPE_BY_KIND is the join between the two. Omit rather than refuse, matching the snapshot sibling: the payload spans ten cards across several domains, and blanking the dashboard because one module is off would be the wrong trade. Core vitals always pass through. The filter runs outside the analytics cache on purpose. That LRU is keyed by user with a 60 s fresh / 1 h stale window and a module toggle does not evict it, so gating inside the builder would keep serving a disabled tile for up to an hour after the user turned it off. Wire shape unchanged -- a gated card is absent, not null.