[COMPASS-4612] Set `directConnection=true` on the connection model for relevant connections Created: 03/Feb/21  Updated: 08/Feb/21  Resolved: 08/Feb/21

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

Type: Bug Priority: Major - P3
Reporter: Rhys Howell Assignee: Rhys Howell
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Vegetable

 Description   

Currently we set `directConnection=true` on the connection model when we connect:
https://github.com/mongodb-js/connection-model/blob/master/lib/connect.js#L228
Using these conditions we should instead set it on the connection model by default, not only when connecting. This is to ensure that any connections using that connection model which don't use that connect method, like compass-shell or vscode playgrounds also have `directConnection=true`.

When `directConnection` is already set on the connection model we should not override it.

In mongodb node driver v4.0 this change around not setting `directConnection=true` when connecting will land. The driver 3.6.3 version prematurely added this change which was reverted in 3.6.4: https://github.com/mongodb/node-mongodb-native/commit/617d9dec5180c5f7b67bd8c944c168d4cbd27e1c 

This impacts both VSCode (playground runtime) and Compass (Compass shell connection arguments).



 Comments   
Comment by Rhys Howell [ 08/Feb/21 ]

This actually only impacts vscode, created: https://jira.mongodb.org/browse/VSCODE-234 so its in the right project.

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