Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-5726

Allow displaying bson binary data where the payload is invalid for the subtype

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.31.2
    • Affects Version/s: 1.31.1
    • Component/s: CRUD
    • Labels:
      None
    • Not Needed
    • Iteration Yonkers

      Reported on github:
      https://github.com/mongodb-js/compass/issues/2974

      Example document which errors Compass now:

      "invalid-uuid": {
        "$binary": "120=",
        "$type": "4"
      }
      

      In previous versions of Compass (using 1.21.2 for reference) we would render binary fields which have invalid payload for the corresponding $type as follows:

      In current Compass this document results in the crud view failing to render:

      What's happening is the `payload`, or `$binary`, of the field does not match the 36 character UUID format (UUID is denoted by the `$type` = 4). https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Binary
      I'm thinking in the recent changes in this area we may have updated how these fields are rendered or parsed with a new bson version and in doing so made the validation more strict thus causing the runtime render error.
      We should allow for displaying these invalid documents as they can exist in a database.

      An example document in this format that displays this error is in the `test.all_types` in the Compass Data Sets deployment.

        1. Screen Shot 2022-04-12 at 2.37.12 PM.png
          17 kB
          Rhys Howell
        2. Screen Shot 2022-04-12 at 2.38.22 PM.png
          90 kB
          Rhys Howell

            Assignee:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: