fix issues with contact sync

this adds the actual last modified timestamp when present, before we used
last advert time as last modified in error

also sets _pendingInitialContactsSync to true on first connect over BLE
This commit is contained in:
Enot (ded) Skelly
2026-04-21 16:44:04 -07:00
parent 6b6a881c7a
commit 820bac0db0
5 changed files with 51 additions and 8 deletions
+9 -4
View File
@@ -735,10 +735,15 @@ Uint8List buildUpdateContactPathFrame(
writer.writeInt32LE((longitude * 1e6).round());
}
if (lastModified != null) {
// Last modified
final lastModifiedTimestamp = lastModified.millisecondsSinceEpoch ~/ 1000;
writer.writeUInt32LE(lastModifiedTimestamp);
final hasLocation = lat != null && lon != null;
if (hasLocation || lastModified != null) {
writer.writeInt32LE(hasLocation ? (lat * 1e6).round() : 0);
writer.writeInt32LE(hasLocation ? (lon * 1e6).round() : 0);
if (lastModified != null) {
// Last modified
final lastModifiedTimestamp = lastModified.millisecondsSinceEpoch ~/ 1000;
writer.writeUInt32LE(lastModifiedTimestamp);
}
}
return writer.toBytes();