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-3998): metadata duplication in handshake #3615

Merged
merged 12 commits into from Mar 31, 2023
Merged

fix(NODE-3998): metadata duplication in handshake #3615

merged 12 commits into from Mar 31, 2023

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Mar 29, 2023

Description

What is changing?

This PR prevents metadata duplication in the handshake. To do this, it removes custom transforms for the driverInfo and appName options and constructs the metadata once at the end of options parsing.

Is there new documentation needed for these changes?

No.

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

@baileympearson baileympearson marked this pull request as ready for review March 29, 2023 16:53
@baileympearson baileympearson changed the title fix metadata issue fix(NODE-3998): fix metadata duplication in handshake Mar 29, 2023
test/unit/cmap/handshake/client_metadata.test.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
test/unit/cmap/handshake/client_metadata.test.ts Outdated Show resolved Hide resolved
test/unit/cmap/handshake/client_metadata.test.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken self-assigned this Mar 29, 2023
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 29, 2023
@nbbeeken nbbeeken changed the title fix(NODE-3998): fix metadata duplication in handshake fix(NODE-3998): metadata duplication in handshake Mar 29, 2023
@@ -526,13 +529,14 @@ export interface ClientMetadata {
version: string;
};
platform: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was wrong, according to the spec: https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.rst#hello-command

this modifies a public interface but it's also technically a bug fix, so I think it's okay to remove

src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
test/unit/cmap/handshake/client_metadata.test.ts Outdated Show resolved Hide resolved
nbbeeken
nbbeeken previously approved these changes Mar 30, 2023
@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 Mar 30, 2023
nbbeeken
nbbeeken previously approved these changes Mar 30, 2023
@baileympearson
Copy link
Contributor Author

evergreen retry

baileympearson and others added 2 commits March 31, 2023 15:34
Co-authored-by: Warren James <warren.james.dev@gmail.com>
Copy link
Contributor

@W-A-James W-A-James left a comment

Choose a reason for hiding this comment

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

LGTM

@nbbeeken nbbeeken merged commit 6d894d6 into main Mar 31, 2023
1 check passed
@nbbeeken nbbeeken deleted the NODE-3998-2 branch March 31, 2023 20:56
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