Azure / azure-cosmosdb-ads-extension

Azure Data Studio extension for Azure CosmosDB
MIT License
16 stars 10 forks source link

Connection name not saved when connecting using "Connection String" option #46

Closed Mushroomator closed 1 year ago

Mushroomator commented 1 year ago

Description

Just a small issue I noticed when creating a new connection to a Cosmos DB with Mongo API. Whenever one tries to connect using a connection string and enters a name for the connection the name will not be saved. This is also true if you edit the connection with the option "Connection String" selected.

If the option "Parameters" is used for creation or editing the connection everything works as expected.

Steps to reproduce

There are two ways to reproduce the issue:

Create connection

  1. Click "New Connection"
  2. Select "Mongo Account"
  3. Select "Connection String"
  4. Enter Connection String and a name
  5. Click "Connect"

Add MongoDB connection with "Connection String" option selected

Edit connection

  1. Select connection
  2. Right click and select "Edit connection"
  3. Select "Connection String"
  4. Enter Connection String and a name
  5. Click Connect

Result

In both scenarios the name is not saved/ shown. Instead the host and port are displayed:

Name is not saved/ displayed

Expected behavior

I would have expected the name to be saved and displayed:

Expected result: Name saved and displayed

Workaround

There is a simple workaround. One can right click on the connection and select "Edit Connection" and it will show the parameters view by default. If you set the name there again it will be saved. If one directly selects the option "Parameters" in step 3 (see Steps to reproduce) the name is saved and displayed on creation, as expected.

Azure Data Studio Version

Version: 1.40.1 (user setup)
Commit: 3a32679ab590c1023ab4de6f191769e7e127d25b
Date: 2022-11-22T18:30:25.850Z
VS Code: 1.67.0
Electron: 17.4.11
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.14-electron.0
OS: Windows_NT x64 10.0.22000

Extension version

v0.1.4