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-6016): flip byte order depending on system endianness #659

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

nbbeeken
Copy link
Contributor

Description

What is changing?

Flipped the order we parse bytes from the float array depending on platform endianness

Is there new documentation needed for these changes?

No.

What is the motivation for this change?

Floats will not serialize or deserialize correctly on big endian systems

Release Highlight

Fixed float byte-wise handling on big endian systems

A recent change to the BSON library started parsing and serializing floats using a Float64Array. When reading the bytes from this array the ordering is dependent on the platform it is running on and we now account for that ordering.

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

@nbbeeken nbbeeken marked this pull request as ready for review March 12, 2024 18:18
@W-A-James W-A-James self-requested a review March 12, 2024 18:22
@W-A-James W-A-James added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 12, 2024
@W-A-James W-A-James self-assigned this Mar 12, 2024
addaleax
addaleax previously approved these changes Mar 12, 2024
test/node/utils/number_utils.test.ts Show resolved Hide resolved
@W-A-James W-A-James merged commit 6a7ef5d into main Mar 12, 2024
2 of 3 checks passed
@W-A-James W-A-James deleted the NODE-6016-fix-endianness branch March 12, 2024 19:28
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.

4 participants