mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
`classifyIntakeTiming` treated `windowStart === windowEnd` as an overnight wrap, inflating a degenerate point window into a ~30h on-time band — a dose taken many hours late still classified `on_time` and fed a perfect-compliance streak. Widen the point window symmetrically instead, matching the treatment `resolveLegacyWindowBounds` already applies. `/api/measurements/batch` never applied the entry-instant plausibility bound its single-entry twin has carried since v1.17 W1b, so a future-dated row landed and permanently won 'latest reading' while poisoning the rollup buckets and the canonical picker. Skip per entry, like the range guard. The past floor stays at 1900 — a historical backfill is a legitimate shape here. The intake CSV import had neither an upper date bound nor a rate limiter, while running up to 1000 sequential find + create + consume iterations per call. Add both, on the bulk twin's bucket shape and budget.