Skip to content

Parent record's modified date time updated when a child record was synced the first time #189

Description

@sskjames

I have two Realm entities where one has a relationship with the other.

class Child: Object, ParentKey {
  @objc dynamic var id: String = ""
  @objc dynamic var parent: Parent?

   static func parentKey() -> String {
        return "parent"
    }
}

class Parent: Object {
}

The Parent record is created and synced to CloudKit. But when the very first Child record is created, I observed that the modifiedDateTime in the CloudKit metadata of the Parent being updated to the Child record's created date time.

As a result, the next time when I make changes to the Parent record, I get a conflict with the CloudKit error code 14, and the changes are lost.

When I make further changes to the Parent or Child record, I don't face any issue. When I create additional Child records, I don't face any issue either.

Appreciate any help I could receive to solve this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions