mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The iOS app writes manual entries into Apple Health, and mirrors Withings and import rows into it, each stamped with dev.healthlog.app.origin = healthlog. The server already holds those readings under their own source, so the same sample arriving through an Apple Health export is a second copy: the series shows it twice and the rollups count it twice. The export import now leaves out a record carrying that marker. The marker is a child <MetadataEntry>, read after the record's open tag, so a record is committed at its close tag. As a fallback for manual entries mirrored before the app set the marker, a record is also left out when a MANUAL row of the same type and value sits within 2 s (same rule and tolerance as the sync path). Withings and import rows are not matched by value and time: they reach Apple Health only through the mirror, which always sets the marker. The import summary says how many records were left out for this reason. Fixes #1109