[COMPASS-6393] Investigate changes in NODE-4892: Add versioning to bson type classes and assert version in serialize and stringify Created: 21/Dec/22  Updated: 01/Feb/23  Resolved: 01/Feb/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Investigation Priority: Major - P3
Reporter: PM Bot Assignee: Unassigned
Resolution: Done Votes: 0
Labels: node-driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on NODE-4892 Add versioning to bson type classes a... Closed
Documentation Changes: Not Needed

 Description   

Use Case

As a node engineer
I want to ensure BSON input types are from the same version as the serializer/stringifier using them
So that there are no unexpected errors or silent serialization issues caused by the mixing of bson versions

User Impact

  • BSON v5 serializer and stringify will throw if given types from a BSON version that is not v5

Unknowns

  • Will we ship this?

Acceptance Criteria

Implementation Requirements

  • Add Symbol.for('@@mdb.bson.version') property to all bson type classes and set it to 5
  • Validate that if a bsontype is detected it has the version number set as expected

Testing Requirements

  • Test that types without a version property throw errors
  • Test that type with a version property serialize as expected

Documentation Requirements

  • Migration guide will have a section on the explicity incompatibility and what the expected support is (all 5.x.x versions work with each other)

Follow Up Requirements

  • Release an alpha with this change and follow up with downstream teams.


 Comments   
Comment by Maurizio Casimirri [ 01/Feb/23 ]

not affecting devtools

Generated at Wed Feb 07 22:42:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.