-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: BSON
-
0
-
Not Needed
-
None
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
Use Case
As a... user of bson library
I want... calculateObjectSize() to return the exact byte count
So that... documents within the 16 MB limit are not incorrectly rejected client-side
User Experience
calculateObjectSize over-reports by 12 bytes per Int32 or BSONSymbol occurrence, causing valid documents to be rejected or buffers to be over-allocated
Dependencies
- None
Risks/Unknowns
- Low risk - no other types affected, no other branches (only size calculation)
Acceptance Criteria
Implementation Requirements
- Add an Int32 branch in calculateElementSize returning the correct 4-byte size.
- Fix the BSONSymbol type guard: 'Symbol' to 'BSONSymbol'.
Testing Requirements
- new unit tests
Documentation Requirements
- N/A
Follow Up Requirements
- N/A