-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-3813): unexpected type conversion of read preference tags #3138
fix(NODE-3813): unexpected type conversion of read preference tags #3138
Conversation
CSFLE failures unrelated and fixed in #3070 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to either unskip or update the TODO tagged to this ticket in uri_options.spec.test
6545f24
to
991c0eb
Compare
a9195e3
to
c996fa4
Compare
c93902e
to
98b1448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/connection_string.ts
Outdated
for (const [key, _value] of entriesFromString(value)) { | ||
if (validKeys.includes(key)) { | ||
if (key === 'CANONICALIZE_HOST_NAME') { | ||
mechanismProperties[key] = getBoolean(key, _value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this is probably going to conflict with Durran's PR to expand the CANONICALIZE_HOST_NAME options (#3131)
src/connection_string.ts
Outdated
@@ -631,7 +634,28 @@ export const OPTIONS = { | |||
target: 'credentials', | |||
transform({ options, values: [value] }): MongoCredentials { | |||
if (typeof value === 'string') { | |||
value = toRecord(value); | |||
const validKeys = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to intentionally silently ignore invalid keys here? Does this actually produce the same behavior as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This array might be unnecessary, the idea was to only translate the type of the keys we know about and leave whatever remains as is (strings). I spoke generally about the options, so that might be where the inspiration came from but I think CANONICALIZE_HOST_NAME
, and gssapiCannoncializeHostname
(which we need to add here, whoops!) are the only ones that need translating to boolean. the rest can remain as strings
Description
What is changing?
This PR does two things:
readPreference
that was converting string values to native JS types, causing spec tests to failIs there new documentation needed for these changes?
No.
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>