Skip to content

Conversation

@paula-stacho
Copy link

@paula-stacho paula-stacho commented Nov 6, 2025

Description

Summary of Changes

This fix ensures that MongoServerError is initialized with values that've been deserialized with promoteValues on.

Notes for Reviewers

Let me know what's a good place to add a test to.

What is the motivation for this change?

This came up in a help ticket from our customer: https://jira.mongodb.org/browse/HELP-83883. The problem was caused by the code sometimes being an Int32 instead of a primitive value. This goes against MongoError type definition:
Screenshot 2025-11-06 at 15 26 15
And it lead to this check failing to catch the 391 as intended:

operationError.code === MONGODB_ERROR_CODES.Reauthenticate
.

Release Highlight

Release notes highlight

Double check the following

  • Lint is passing (npm run check:lint)
  • 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

@paula-stacho paula-stacho requested a review from a team as a code owner November 6, 2025 14:35
@paula-stacho paula-stacho changed the title fix: deserialize error with promoteValues fix(NODE-7290): deserialize error with promoteValues Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant