mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
The 7-day window on the dashboard chart still pulls raw rows from `/api/measurements` (the server-side `aggregate=daily` path kicks in only for windows over a week). The client-side daily aggregator then reduced every per-day bucket with `sum / count`, which averages step counts across the per-sample rows Apple Health emits instead of summing them. Steps on a 7-day view rendered as the per-sample average (hundreds), not the daily total. The reduction now branches on `CUMULATIVE_HK_TYPES` (the same set that drives the server-side SQL aggregator in v1.4.29): cumulative types reduce with `sum`, spot metrics keep the `sum / count` average.