fix: determine Atlas connection from connection String#6867
Conversation
Atlas Metadata is never set before setting a connection so it is erroneous to use it when connecting. This uses a utility method instead that checks the connection string.
| isAtlas: isAtlas( | ||
| connectionInfo.connectionOptions.connectionString | ||
| ), |
There was a problem hiding this comment.
Can this be completely encapsulated inside the adjustConnectionOptionsBeforeConnect method? Is there any reason to keep this logic configurable from outside if we always want this to be applied based on the connection string?
Just so it doesn't cause you confusion in the future, the metadata is always set on the connectionInfo object if this is a connection info returned by Atlas control plane, this is only applicable to compass-web that is integrated in the mms at the moment though, never compass desktop |
gribnoysup
left a comment
There was a problem hiding this comment.
Looks good, but I do have a question if we need to keep this configurable from outside if this logic should always activate if applicable and the detection method depends only on the values that we already pass to the method
Ah that makes sense, thank you, I had trouble following how it ends up set. Maybe I could add that as comment on the field to make that clearer |
|
|
||
| /** | ||
| * The metdata for the Atlas cluster | ||
| * The metadata for the Atlas cluster. Set from Atlas control plane when using compass-web. |
There was a problem hiding this comment.
@gribnoysup just added this comment from better awareness
Atlas Metadata is not set on Compass Desktop environments, so instead this determines it through the connection string.