realm-swift icon indicating copy to clipboard operation
realm-swift copied to clipboard

Asymmetric Sync

Open dianaafanador3 opened this issue 2 years ago • 1 comments

Add Support for asymmetric sync. When an object inherit from AsymmetricObject is immediately marked as asymmetric, upon creation this objects is sync'd unidirectionally and cannot be query locally.

    class PersonObject: AsymmetricObject {
       @Persisted(primaryKey: true) var _id: ObjectId = ObjectId.generate()
       @Persisted var name: String
       @Persisted var age: Int
    }

    try realm.write {
       let person = PersonObject(name: "Dylan", age: 20, isFavorite: true)
       realm.create(person) // This will create the object and sync'd unidirectionally.
    }

dianaafanador3 avatar Jul 12 '22 14:07 dianaafanador3

@tgoyne seems like the CI failures doesn't have anything to do with the PR, I don't know the reason the test are not able to execute.

dianaafanador3 avatar Jul 29 '22 18:07 dianaafanador3