[Snyk] Upgrade bson from 6.9.0 to 6.10.4 #533
Open
+5
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade bson from 6.9.0 to 6.10.4.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 6 versions ahead of your current version.
The recommended version was released 24 days ago.
Release notes
Package name: bson
6.10.4 (2025-06-02)
The MongoDB Node.js team is pleased to announce version 6.10.4 of the
bson
package!Release Notes
Top-Level Await removed from the browser BSON bundle
In versions <6.10.4, BSON uses a top-level await to asynchronously import the
crypto
module. This change unintentionally caused headaches for users of webpack, react native, vite and other tools bundlers and tools.The top-level await has been removed from all BSON bundles. Thanks to @ lourd for this contribution.
Prevent the creation of incorrectly sized float32 vectors
This adds validation to our
BSON.serialize
andEJSON.stringify
methods that will prevent creating float 32 vectors that are not a multiple of 4. Previously created vectors that do not meet this validation will still bedeserialized
andparsed
so they can be fixed.Additionally, the
toFloat32Array()
,toInt8Array()
, andtoPackedBits()
methods now perform the same validation that serialize does to prevent use of incorrectly formatted Binary vector values. (For example, a packed bits vector with more than 7 bits of padding)Vectors of an incorrect length could only be made manually (directly constructing the bytes and calling
new Binary
). We recommend usingtoFloat32Array
andfromFloat32Array
when interacting with Vectors in MongoDB as they handle the proper creation and translation of this data type.Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.6.10.3 (2025-02-19)
The MongoDB Node.js team is pleased to announce version 6.10.3 of the
bson
package!Release Notes
useBigInt64
is enabledAfter refactoring to improve deserialization performance in #649, we inadvertently introduced a bug that manifested when deserializing
Long
values with theuseBigInt64
flag enabled. The bug would lead to negativeLong
values being deserialized as unsigned integers. This issue has been resolved here.Thanks to @ rkistner for reporting this bug!
Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.6.10.2 (2025-01-29)
The MongoDB Node.js team is pleased to announce version 6.10.2 of the
bson
package!Release Notes
Fix
calculateObjectSize
not accounting forBigInt
value sizeBSON.calculateObjectSize
was missing a condition forBigInt
values, meaning it did not account for them in the same way that it would forLong
values. This has been corrected so thatBigint
values contribute 8 bytes worth of size to the total count.We also added a new default condition that will catch any new values that may be returned by
typeof
in the future and will throw an error rather than returning an inaccurate size.Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.6.10.1 (2024-11-27)
The MongoDB Node.js team is pleased to announce version 6.10.1 of the
bson
package!Release Notes
Fix issue with the internal unbounded type cache
As an optimization, a previous performance improvement stored the type information of seen objects to avoid recalculating type information. This caused an issue in the driver under extreme load and high memory usage as the cache grew. The assumption was that garbage collection would clear it enough to sustain normal operation. The cache is now removed and other optimal type checking is used in its place.
Cache the hex string of an ObjectId lazily
When
ObjectId.cacheHexString
is set totrue
we no longer convert the buffer to a hex string in the constructor, since the cache is already being filled in any call toobjectid.toHexString()
.Additionally, if a string is passed into the constructor we can cache this immediately as there is no performance impact and no extra memory that needs to be allocated.
This improves the performance for situations where you are parsing ObjectIds from a string (ex.
JSON
) and want to avoid recalculating the hex. It also improves situations where you have ObjectIds coming from BSON and only convert some of them strings perhaps after applying some filter to eliminate some.With
cacheHexString
enabled deserializing ObjectIds from BSON shows ~80% performance improvement andtoString
-ing ObjectIds that were constructed from a string convert ~40% faster!Thanks to @ SeanReece for contributing this improvement!
Bug Fixes
Performance Improvements
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.6.9.1 (2025-03-06)
The MongoDB Node.js team is pleased to announce version 6.9.1 of the
bson
package!Release Notes
useBigInt64
is enabledAfter refactoring to improve deserialization performance in #649, we inadvertently introduced a bug that manifested when deserializing
Long
values with theuseBigInt64
flag enabled. The bug would lead to negativeLong
values being deserialized as unsigned integers. This issue has been resolved here.Thanks to @ rkistner for reporting this bug!
Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: