js-bson - PR #910: fix: count ES Map entries in calculateObjectSize

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • bson-7.3.2
    • Affects Version/s: None
    • Component/s: None
    • 2
    • 2
    • Not Needed
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      spokodev has created PR #910: fix: count ES Map entries in calculateObjectSize in js-bson

      Use Case

      As a user of the js-bson library
      I want calculateObjectSize to calculate valid bson inputs which include nested or root-level ES maps
      So that preallocated buffer value assignments (and other size dependant operations) which rely on object sizes are successful

      User Experience

      • The types supported in our size calculations for bson objects are not accurate specifically for the 'Map' document type which is a valid and known document type for bson through the library. This type today is skipped over.
        Expected behaviour is that Map's should not be skipped, they should be walked and sized appropriately

      Dependencies

      • N/A

      Risks/Unknowns

      • The nodejs driver could potentially send an oversized document over the wire since size validation checks on documents can be bypassed by sending a Map, which uses calculateObjectSize as a part of its validation criteria

      Acceptance Criteria

      Implementation Requirements

      • Handle maps in calculateObjectSize

      Testing Requirements

      • Unit test to cover the fix

      Documentation Requirements

      • N/A

      Follow Up Requirements

      • N/A

            Assignee:
            Pavel Safronov
            Reporter:
            TPM Jira Automations Bot
            Pavel Safronov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: