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

Feature/ssl param #335

Merged
merged 5 commits into from
Feb 22, 2022
Merged

Conversation

justinmchase
Copy link
Contributor

When you create an Azure cosmos db it gives you a connection string like this:

mongodb://example:<redacted>@example.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@example@

However when you try to use this connection string to actually connect it basically hangs indefinitely. After some debugging I figured out that the connection string parsing is simply not handling the ssl=true parameter. Simply setting tls = true in this case allows deno_mongo to successfully connect to azure cosmosdb.

@justinmchase
Copy link
Contributor Author

justinmchase commented Feb 20, 2022

A couple other things I noticed by didn't touch:

  • azure's connection string has retrywrites instead of retryWrites and this libraries parse function is case sensitive.
  • This library emits no errors or warnings for parameters in the connection string it doesn't support or understand.
  • The connection hangs with no timeouts and no errors in the case of a bad connection string
  • You've wrapped all your unit tests in a function then import that function and invoke it... In the latest version of Deno this makes it harder to just run the tests for a single file

@erfanium
Copy link
Member

@justinmchase Thank you Justin for making this PR
Is this PR mergeable or you are still working on it? because there is some failed tests here

this libraries parse function is case sensitive

This library emits no errors or warnings for parameters in the connection string it doesn't support or understand.

The connection hangs with no timeouts and no errors in the case of a bad connection string

It's welcome to fix all of these issues, if your expected behaviors are a part of MongoDB standard driver specifications

You've wrapped all your unit tests in a function then import that function and invoke it... In the latest version of Deno this makes it harder to just run the tests for a single file

yes, really not a good design, PR is welcome :-)

@justinmchase
Copy link
Contributor Author

My bad, I thought I re-ran the test but apparently I didn't. I fixed it now but some other test is not succeeding. Locally its passing and in 3/4 versions of ubuntu it seems to be passing. I'm not sure what to do about it. It seems unrelated to this change.

Copy link
Member

@erfanium erfanium left a comment

Choose a reason for hiding this comment

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

Thank you Justin. That's awesome

@erfanium
Copy link
Member

@lucsoft
Is it good to you?

@lucsoft
Copy link
Collaborator

lucsoft commented Feb 22, 2022

I mean it's fixes the issue but we need to refactor the parser lmao

But this is not a scope for this PR

@erfanium erfanium merged commit 92316c9 into denodrivers:main Feb 22, 2022
@justinmchase justinmchase deleted the feature/ssl-param branch February 22, 2022 19:39
@justinmchase
Copy link
Contributor Author

Thanks everyone.

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.

3 participants