commit b2abc4d1c8af7198cc7850923eb871ea0c5b283f
parent 9b285ad724c8f424dc46040ab063d4faf7e7aa21
Author: Michael Camilleri <[email protected]>
Date: Sun, 10 May 2026 19:23:16 +0900
Simplify push notification fallback
Diffstat:
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/Crossmate/Sync/SyncEngine.swift b/Crossmate/Sync/SyncEngine.swift
@@ -484,15 +484,9 @@ actor SyncEngine {
since: Date?,
desiredKeys: [CKRecord.FieldKey]
) async throws -> [CKRecord] {
- let predicate: NSPredicate
- if let since {
- predicate = NSPredicate(format: "modificationDate > %@", since as NSDate)
- } else {
- predicate = NSPredicate(value: true)
- }
-
+ let since = since ?? Date(timeIntervalSince1970: 0)
+ let predicate = NSPredicate(format: "modificationDate > %@", since as NSDate)
let query = CKQuery(recordType: type, predicate: predicate)
- query.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: true)]
var records: [CKRecord] = []
var result = try await database.records(