Skip to content

Commit 6726202

Browse files
committed
This change updates how metadata is built for Health Connect synchronization. Instead of using the measurement's timestamp for clientRecordVersion, it now uses the current timestamp (Instant.now()). This ensures that each synchronization attempt is treated as a unique version, forcing an update of the record in Health Connect.
1 parent 747b4ac commit 6726202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/src/main/java/com/health/openscale/sync/core/sync/HealthConnectSync.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class HealthConnectSync(private var healthConnectClient: HealthConnectClient) :
193193
private fun buildMetadata(measurement: OpenScaleMeasurement, type: String): Metadata {
194194
return Metadata.manualEntry(
195195
clientRecordId = measurement.id.toString() + "_" + type,
196-
clientRecordVersion = measurement.date.time
196+
clientRecordVersion = Instant.now().toEpochMilli()
197197
)
198198
}
199199

0 commit comments

Comments
 (0)