[COMPASS-5309] Move directConnection=true manipulation from connectMongoClient to convertConnectionModelToInfo Created: 18/Nov/21  Updated: 17/Jan/22  Resolved: 17/Jan/22

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Task Priority: Critical - P2
Reporter: Maurizio Casimirri Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to COMPASS-5377 Should Compass implicitly set directC... Closed
Epic Link: COMPASS-4948
Documentation Changes: Not Needed

 Description   

NOTE: this MUST be done before enabling the new form, otherwise the directConnection setting won't be captured in the initial migration and will require a new migration to keep backward compatibility.

It can be done even before the new form is ready, as it would work well also with the old form.

Description:

These lines: https://github.com/mongodb-js/compass/blob/ecda9f93d998136f566e15d6f433e3892349f054/packages/data-service/src/connect-mongo-client.ts#L104-L111

are adding `directConnection=true` arbitrarily whenever is possible on behalf of the user, and this behaviour cannot be disabled.

Now that `directConnection` is surfaced in the form, we want to move this to the conversion from connection model to connection info, so it will be persisted, the user will have control over it, and won't cause any unexpected behaviour anymore.



 Comments   
Comment by Maurizio Casimirri [ 17/Jan/22 ]

With the changes to use socks5 with SSH the directConnection should not be necessary anymore for most connections to work and only be absolutely required to target a specific node. For that reason excluding it from the migration won't cause backward compatibility issues.

Generated at Wed Feb 07 22:39:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.