• Type: Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-6.0.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Needed
    • Needed
    • Hide
      1. What would you like to communicate to the user about this feature?
        • ObjectId now only allows strings of length 24 which contain hex characters (rationale in PR)
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
        • no
      3. Which versions of the driver/connector does this apply to?
        • bson >= v6
      Show
      What would you like to communicate to the user about this feature? ObjectId now only allows strings of length 24 which contain hex characters (rationale in PR ) Would you like the user to see examples of the syntax and/or executable code and its output? no Which versions of the driver/connector does this apply to? bson >= v6

      Details

      As of v4.2.0 ObjectId's began interpreting strings of length 12 as UTF8 instead of latin1. We should remove support for strings that aren't exactly hex strings to make construction from string input clear and lack a variation of interpretations.

      AC

      • Only allow strings of length 24 that contain hex characters
      • Remove strings of length 12 from objectId constructor
      • Update tests

      Drive-by improvement

      • Now that we are developing on Node.js 20 there are dev dependencies we do not need to always install that are failing on Node.js 20.
        • Remove v8-profiler-next and add tar

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: