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-3705): ReadPreference.fromOptions omitting hedge and maxStalenessSeconds when readPreference is a string #3060

Merged

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Nov 30, 2021

Description

Prior to these changes, when ReadPreference.fromOptions was passed a string for the read preference, hedge configuration and maxStalenessSeconds were not set on the ReadPreference object. This PR passes hedge configuration and maxStalenessSeconds configuration through to the read preference object when it is created using ReadPreference.fromOptions with a string as the read preference.

Additionally, this PR moves unit tests for the ReadPreference class into the unit test suite from the functional test suite.

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>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

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.

Nice! this looks close to ready

src/read_preference.ts Show resolved Hide resolved
test/functional/readpreference.test.js Outdated Show resolved Hide resolved
test/functional/readpreference.test.js Outdated Show resolved Hide resolved
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 30, 2021
@baileympearson baileympearson changed the title fix(NODE-3705): propagate hedge settings through ReadPreference.fromOptions fix(NODE-3705): fix ReadPreference.fromOptions factory method when read preference is a string Nov 30, 2021
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.

Just some more small improvements, but I'll open this up to the team now

test/unit/read_preference.test.js Outdated Show resolved Hide resolved
test/unit/read_preference.test.js Outdated Show resolved Hide resolved
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Nov 30, 2021
Signed-off-by: Bailey Pearson <bailey.pearson@mongodb.com>
@nbbeeken nbbeeken changed the title fix(NODE-3705): fix ReadPreference.fromOptions factory method when read preference is a string fix(NODE-3705): ReadPreference.fromOptions omitting hedge and maxStalenessSeconds when readPreference is a string Dec 1, 2021
@nbbeeken nbbeeken merged commit b9fbac5 into main Dec 1, 2021
@nbbeeken nbbeeken deleted the NODE-3705/enable-hedge-options-when-readPreference-is-string branch December 1, 2021 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
3 participants