-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(NODE-6355): respect utf8 validation options when iterating cursors #4214
Conversation
62302b7
to
2b21104
Compare
test/integration/node-specific/bson-options/utf8_validation.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The c3a9
condition is failing. Perhaps we need to be a bit more robust, searching for c3a9
after finding "insert"
or "documents"
so we know we're in the command.
Please update and release it as soon as possible, as we are currently troubled by this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
What is changing?
This PR ensures that any BSON utf8 validation options are provided to the deserializer when deserializing cursors.
Since on-demand BSON, cursors are deserialized on-demand. Documents are pulled out of the cursor using
MongoDBResponse.get()
, which returns an unparsed on-demand document. We then deserialize it usingtoObject()
.However, although
MongoDBResponse
correctly applies BSON utf8 options to its deserialization logic, the on-demand document does not. This results in documents retrieved from a cursor being deserialized without the utf8 validation options.Is there new documentation needed for these changes?
What is the motivation for this change?
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript