Skip to content
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-6600): set object mode for message chunking correctly #4345

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

addaleax
Copy link
Contributor

@addaleax addaleax commented Dec 3, 2024

Description

What is changing?

Is there new documentation needed for these changes?

What is the motivation for this change?

We're now aligning with the Node.js streams API contract.

Release Highlight

Socket read stream set to object mode

Socket data was being read with a stream set to buffer mode when it should be set to object mode to prevent inaccurate data chunking, which may have caused message parsing errors in rare cases.

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson self-assigned this Dec 3, 2024
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 3, 2024
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the release notes for this?

@addaleax
Copy link
Contributor Author

addaleax commented Dec 4, 2024

@nbbeeken Do you think this is worth calling out in release notes?

@nbbeeken
Copy link
Contributor

nbbeeken commented Dec 4, 2024

Yes even if it is just a sentence that points to what is being corrected without elaborating in detail we should inform what folks may have faced if this is a bug that could have occurred on this or prior versions. The versions that have this correctness issue may be in use for years and we'll want a guide that describes in human terms what the problem was as a reference.

I think this could work if it sounds accurate to you:

Socket read stream set to object mode

Socket data was being read with a stream set to buffer mode when it should be set to object mode to prevent inaccurate data chunking, which may have caused message parsing errors in rare cases.

@addaleax
Copy link
Contributor Author

addaleax commented Dec 4, 2024

@nbbeeken Sure, that works for me 🙂

@baileympearson baileympearson merged commit 5558573 into mongodb:main Dec 4, 2024
26 of 29 checks passed
@addaleax addaleax deleted the 6600-dev branch December 4, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants