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

Sync Server Fuzzer found inconsistency applying empty binary/string to mixed list

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      The fuzzer captured this failure. I reproduced it to this minimal test case.

      Apply these instructions:

      AddTable { table: gr, tableType: Top-Level, pkName: _id, pkType: String, pkNullable: false }
      AddColumn { table: gr, field: vg, type: Mixed, collection: List, isNullable: true, targetTable:  }
      CreateObject { table: "gr", id: "{String: "cavhdqmgvna"}" }
      ArrayInsert { (table="gr", ID="{String: "cavhdqmgvna"}", fullPath="vg.0"), payload: {Binary: Binary(string: , raw: [])}, priorSize: 0 }
      Update { (table="gr", ID="{String: "cavhdqmgvna"}", fullPath="vg.0"), payload: {String: ""}, isDefault: false, priorSize: 1 }
      

      And the result of the object will be:

      {
      "class_gr":[{"_id":"cavhdqmgvna","vg":[{"$binary": {"base64": "", "subType": "00"}}]}]
      }
      

      As you can see, setting a mixed list to just be a single element with an empty binary payload and then updating it to be an empty string winds up resulting in the list still just being an empty binary.

      I updated the binaries we are using to the most recent master release for realm-core.

      This reminds me of this ticket and I would bet its related in some way: https://jira.mongodb.org/browse/RCORE-802

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            tyler.kaye@mongodb.com Tyler Kaye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: