mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
TemperatureSyncer is the only syncer implementing HealthConnectSyncer directly instead of inheriting from AbstractTimeSampleSyncer or AbstractActivitySampleSyncer, both of which populate latestRecordTimestamp in their base sync(). Its hand-rolled sync() never set the field, so the orchestrator had nothing to advance the persisted cursor with and the TEMPERATURE cursor stayed pinned at its starting value. Every sync then re-read from that frozen point to now and re-inserted the whole span; the per-record clientRecordId dedup hid the duplicates in Health Connect, so it was silent but re-inserted weeks of records on each run. Return the furthest-forward edge of the inserted records (body record time, skin record endTime) as latestRecordTimestamp on the success path. The no-op early returns keep it null, which correctly holds the cursor, matching every other syncer's "nothing synced" behaviour. The cursor self-heals on the next successful sync; no reset needed.