mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
Before the source-collapse fix, a day with both an Apple Health AND a Withings write for the same cumulative metric (steps, active energy, flights, distance, daylight, falls) summed both sources into one inflated total and locked it in as the all-time PersonalRecord. The worker's improvement gate only ever compares a freshly-computed day against the stored best, so the false record silently outranked every honest day forever and the affected metric could never set a genuine record again. Adds a boot-time one-shot repair (queue: cumulative-pr-rederive), mirroring the existing step-consolidation-repair pattern: deletes the suspect measurement-driven records created before the fix landed, then re-runs detection with silent:true so the honest re-derived best replaces it without firing a "new record" push for what is data hygiene, not an achievement. Self-converging by a fixed cutoff instant rather than a marker column or reused SQL migration number.