Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1102

Exception when deleting object that has a link to itself

      realm-apply-to-state --verbose -r $(mktemp realmXXX --tmpdir) -i fuzz_test_tmp/qbs_client_reconnect_default_schema_default_operations_3_clients_40_writes1221335157/messages_62846721b5847196171bd463.txt
      found upload changeset: 0 0 1 1 155
      Decoded changeset: [changeset with 14 instructions]
      found upload changeset: 1 1 1 1 1705
      Decoded changeset: [changeset with 69 instructions]
      group.add_embedded_table("class_at");
      group.add_embedded_table("class_hc");
      group.get_or_add_table_with_primary_key(group, "class_kf", type_ObjectId, "_id", true);
      group.add_embedded_table("class_ut");
      integrated local changesets as version 2
      sync::create_object_with_primary_key(group, get_table("class_kf"), 735faf873fcf1884b1f94443);
      terminate called after throwing an instance of 'realm::KeyNotFound'
        what():  No object with key '1' in 'class_at'
      Aborted
      

      I've attached the messages file that causes this. Human readable instructions:

      Changeset #1:
      { timestamp: 123, fileIdent: 2, clientVersion: 0, serverVersion: 2, instructions: [
               CreateObject { table: "kf", id: "{ObjectID: ObjectID("735faf873fcf1884b1f94443")}" },
               Update { (table="kf", ID="{ObjectID: ObjectID("735faf873fcf1884b1f94443")}", fullPath="ce"), payload: {Null: null}, isDefault: false, priorSize: 0 },
               Update { (table="kf", ID="{ObjectID: ObjectID("735faf873fcf1884b1f94443")}", fullPath="ce"), payload: {ObjectValue: ObjectValue()}, isDefault: false, priorSize: 0 },
               Update { (table="kf", ID="{ObjectID: ObjectID("735faf873fcf1884b1f94443")}", fullPath="ce.wj"), payload: {Null: null}, isDefault: false, priorSize: 0 },
               Update { (table="kf", ID="{ObjectID: ObjectID("735faf873fcf1884b1f94443")}", fullPath="ce.wj"), payload: {ObjectValue: ObjectValue()}, isDefault: false, priorSize: 0 },
               SetInsert { (table="kf", ID="{ObjectID: ObjectID("735faf873fcf1884b1f94443")}", fullPath="ce.wj.zs"), payload: {Link: RealmLink(table: "kf", key: ObjectID("735faf873fcf1884b1f94443"))} },
               EraseObject { table: "kf", id: "{ObjectID: ObjectID("735faf873fcf1884b1f94443")}" },
               CreateObject { table: "kf", id: "{ObjectID: ObjectID("735faf873fcf1884b1f94443")}" },
      ]}
      

      The schema is randomly generated by the sync server fuzz harness, I've also attached a json file that includes the schema

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            kiro.morkos@mongodb.com Kiro Morkos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: