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-6764): incorrect negative bigint handling #752

Merged
merged 7 commits into from
Feb 19, 2025
Merged

Conversation

W-A-James
Copy link
Contributor

@W-A-James W-A-James commented Feb 18, 2025

Description

Correct regression to bigint deserialziation introduced in #649

What is changing?

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

⚠️ Fixed potential data corruption bug when useBigInt64 is enabled

After refactoring to improve deserialization performance in #649, we inadvertently introduced a bug that manifested when deserializing Long values with the useBigInt64 flag enabled. The bug would lead to negative Long values being deserialized as unsigned integers. This issue has been resolved here.

Thanks to @rkistner for reporting this bug!

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

@W-A-James W-A-James marked this pull request as ready for review February 18, 2025 18:28
@W-A-James W-A-James requested a review from a team as a code owner February 18, 2025 18:28
@W-A-James W-A-James changed the title fix(NODE-6764): incorrect bigint handling fix(NODE-6764): incorrect negative bigint handling Feb 18, 2025
Copy link

@rkistner rkistner left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix! The change looks good to me, and should fix the issue I had

@@ -105,6 +105,39 @@ describe('BSON BigInt support', function () {

it(description, test);
}

describe('edge case tests', function () {
Copy link
Member

@durran durran Feb 19, 2025

Choose a reason for hiding this comment

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

Just a little nit. Instead of just calling these edge case tests can we better describe what we are testing here? I'd personally prefer individual it blocks with specific descriptions than the generic describe and loop.

@durran durran self-assigned this Feb 19, 2025
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 19, 2025
@nbbeeken nbbeeken self-requested a review February 19, 2025 15:27
@W-A-James W-A-James requested a review from nbbeeken February 19, 2025 16:32
@baileympearson baileympearson merged commit b3212b4 into main Feb 19, 2025
8 checks passed
@baileympearson baileympearson deleted the NODE-6764 branch February 19, 2025 16:55
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.

5 participants