Commit Graph
3 Commits
Author SHA1 Message Date
Gideon Zenz 26dc2879d9 Health Connect: Fix partial sleep sessions not being replaced by full data
Sleep sessions that grow over time (partial data synced mid-sleep, full
data available after waking) were permanently stuck as partial records
in Health Connect. The sync cursor advanced past the session's start
after the first sync, so the full session was never re-processed.

Fix with two mechanisms:
- Set clientRecordId per sleep session (deterministic from device +
  start hour) with clientRecordVersion = stage count, enabling HC's
  native upsert: re-inserting the same session replaces partial data
  with the full record.
- Hold the sync cursor behind sessions that ended less than 6 hours
  ago (likely still in-progress), so they get re-processed on the
  next sync with more complete data.
2026-04-07 00:35:58 +02:00
Gideon Zenz 68475a07fd Health Connect: Use separate start/end offsets for workout records
Resolve ZoneOffset independently for workout start and end instants,
so workouts spanning a DST transition get correct offset metadata on
both ends.
2026-04-05 23:40:57 +02:00
Gideon Zenz 746bc16bfa Health Connect: Use per-timestamp timezone offset for DST correctness
Replace single sync-time ZoneOffset with ZoneId, resolving the correct
offset per record timestamp via ZoneId.rules.getOffset(instant). Fixes
wrong offset metadata on records crossing DST boundaries (e.g. sleep
sessions starting in CET and ending in CEST).

Also fixes leading space in device model name after manufacturer prefix
strip.
2026-04-05 23:40:57 +02:00