-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: 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