mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 22:30:34 +01:00
fix rare duplication of uniqueID values during import when an import candidate is added by a previous insertion block
This commit is contained in:
@@ -230,7 +230,10 @@ extension BaseDataTransaction {
|
||||
}
|
||||
try autoreleasepool {
|
||||
|
||||
if let object = existingObjectsByID[objectID] {
|
||||
if let object = existingObjectsByID[objectID]
|
||||
?? self.context.insertedObjects
|
||||
.compactMap({ O.cs_matches(object: $0) ? O.cs_fromRaw(object: $0) : nil })
|
||||
.first(where: { $0.uniqueIDValue == objectID }) {
|
||||
|
||||
guard entityType.shouldUpdate(from: source, in: self) else {
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ extension DiffableDataSource {
|
||||
*/
|
||||
open class TableViewAdapter<O: DynamicObject>: BaseAdapter<O, DefaultTableViewTarget<UITableView>>, UITableViewDataSource {
|
||||
|
||||
// MARK: Publi
|
||||
// MARK: Public
|
||||
|
||||
/**
|
||||
Initializes the `DiffableDataSource.TableViewAdapter`. This instance needs to be held on (retained) for as long as the `UITableView`'s lifecycle.
|
||||
|
||||
@@ -53,7 +53,7 @@ import CoreData
|
||||
)
|
||||
```
|
||||
*/
|
||||
public protocol ImportableUniqueObject: ImportableObject {
|
||||
public protocol ImportableUniqueObject: ImportableObject, Hashable {
|
||||
|
||||
/**
|
||||
The data type for the entity's unique ID attribute
|
||||
|
||||
Reference in New Issue
Block a user