fix tests

This commit is contained in:
John Estropia
2026-07-15 19:54:47 +09:00
parent 890e150b95
commit 1ea9ad7c4a
12 changed files with 109 additions and 58 deletions
+14
View File
@@ -59,6 +59,11 @@ public protocol ObjectRepresentation: AnyObjectRepresentation {
*/
associatedtype ObjectType: DynamicObject
/**
The `Sendable` ID to use for referencing the object between isolation contexts.
*/
func persistentID() -> ObjectType.ObjectID
/**
An instance that may be observed for object changes.
*/
@@ -85,6 +90,7 @@ public protocol ObjectRepresentation: AnyObjectRepresentation {
func asSnapshot(in transaction: BaseDataTransaction) -> ObjectSnapshot<ObjectType>?
}
extension NSManagedObject: ObjectRepresentation {}
extension CoreStoreObject: ObjectRepresentation {}
@@ -92,6 +98,14 @@ extension CoreStoreObject: ObjectRepresentation {}
extension DynamicObject where Self: ObjectRepresentation {
// MARK: Public
/**
The `Sendable` ID to use for referencing the object between isolation contexts.
*/
public func persistentID() -> Self.ObjectID {
return .init(managedObjectID: self.cs_id())
}
/**
An `ObjectPublisher` wrapper for the exact same object