mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
The dose-to-slot pairing matched a logged intake against the slot's window *centre*. For a wide intraday window (a twice-daily 07:00–19:00 med spans 12h, so its 07:00 slot centres at 13:00 and its 19:00 slot at 01:00 the next day) the centre sits between the real dose times, so an off-time take paired to the wrong slot: a morning dose logged late could land on the evening slot, a deliberate user-skip could read as taken, and a late evening take could read as missed — distorting the compliance rate for an irregular twice-daily taker. The intake write path already snaps each dose's scheduledFor to its canonical slot instant, which identifies the slot unambiguously. Add an exact-anchor pass that claims the slot whose windowStart matches the intake's scheduledFor (±1 min) before the proximity fallback. Rows that don't line up on a slot instant (legacy un-snapped data, sparse off-day takes) keep the existing proximity match, so every prior cadence fixture is byte-stable.