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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.31.1
    • 1.31.2
    • CRUD
    • None
    • Not Needed
    • Iteration Yonkers

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: