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

feat(NODE-6773): add multiple collinfo option #70

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addon/mongocrypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ MongoCrypt::MongoCrypt(const CallbackInfo& info) : ObjectWrap(info) {

mongocrypt_setopt_retry_kms(mongo_crypt(), true);

mongocrypt_setopt_enable_multiple_collinfo(mongo_crypt());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: The driver may need a way to know if this is set

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shouldn't be necessary, only an updated libmongocrypt will request more than one collInfo

Copy link
Collaborator

@baileympearson baileympearson Feb 21, 2025

Choose a reason for hiding this comment

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

Isn't the issue when an updated libmongocrypt interacts with a driver that isn't updated though (i.e., driver pre 6.14)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, unfortunately having moved the JS code for the bindings into the driver means that that's a case we now need to handle – this option would have to be passed from JS to the constructor instead of being set unconditionally

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a new option to control this, not sure how I would test this here since you can't inspect the properties of the struct (of course) and there doesn't seem to be a getopt API.

We can flip the option in the driver, and your $lookups fail as a result.


// Initialize after all options are set.
if (!mongocrypt_init(mongo_crypt())) {
throw TypeError::New(Env(), errorStringFromStatus(mongo_crypt()));
Expand Down
Loading