Skip to content

Commit

Permalink
Fix CoreData merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jann Schafranek committed Sep 29, 2024
1 parent c5586c3 commit ea66522
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/SwiftDataSync/Synchronizer/SDSSynchronizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public class SDSSynchronizer {
})
self.container = container
let context = container.newBackgroundContext()
context.automaticallyMergesChangesFromParent = true
context.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
self.context = context
self.savedState = context.performAndWait({
(try? context.fetch(SDSSynchronizerSavedState.fetchRequest()).first) ??
Expand Down

0 comments on commit ea66522

Please sign in to comment.