Skip to content

Commit 0471af5

Browse files
committed
Skip re-delivered server records on upsert
1 parent cf77b8f commit 0471af5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,10 @@
19721972
let hasConflict = hasServerChanged && hasClientChanged
19731973
print("hasServerChanged", hasServerChanged, "hasClientChanged", hasClientChanged, "hasConflict", hasConflict)
19741974

1975+
// Proceed only when the server record has changed (skipping re-delivered records)
1976+
// or when force-upserting.
1977+
guard hasServerChanged || force else { return }
1978+
19751979
if hasConflict {
19761980
// Sets the record-level userModificationTime to the max of the client and server
19771981
// modification times, which effectively records the time at which the conflict

0 commit comments

Comments
 (0)