We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46cb5c9 commit ab6b1d9Copy full SHA for ab6b1d9
1 file changed
Sources/CoreDataRepository/CoreDataRepository.swift
@@ -70,7 +70,11 @@ public final class CoreDataRepository: @unchecked Sendable {
70
return result
71
}
72
try scratchPad.performAndWait {
73
- guard scratchPad.hasChanges, !transaction.canceled else {
+ guard scratchPad.hasChanges else {
74
+ return
75
+ }
76
+ guard !transaction.canceled else {
77
+ scratchPad.reset()
78
return
79
80
do {
@@ -81,7 +85,11 @@ public final class CoreDataRepository: @unchecked Sendable {
81
85
82
86
83
87
try context.performAndWait {
84
- guard context.hasChanges, !transaction.canceled else {
88
+ guard context.hasChanges else {
89
90
91
92
+ context.rollback()
93
94
95
context.transactionAuthor = transactionAuthor
0 commit comments