[COMPASS-5745] Connection string with unescaped characters doesn't error on connect Created: 18/Apr/22  Updated: 07/Sep/22  Resolved: 07/Sep/22

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

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

Issue Links:
Duplicate
duplicates COMPASS-5958 Connections Favourites are not periss... Closed
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Barnacle, Iteration Cuttlefish, Iteration Dolphin

 Description   

A connection string with an unescaped character in the password or appName (and probably other params) can be successfully saved and connected to, however it fails to load.

We should error when connecting with or saving a connection string that contains invalid characters as we want users to escape these characters.

It looks like this only happens when the connection has authentication, without authentication I receive the expected error. `Password contains unescaped characters`

The loading error from the logs:

{"t":{"$date":"2022-04-18T17:26:54.019Z"},"s":"E","c":"COMPASS-DATA-SERVICE","id":1001000102,"ctx":"Connection Storage","msg":"Failed to load connection, error while converting from model","attr":{"message":"Username contains unescaped characters sofloo@sofloo.mongo.cosmos.azure.com"}}

The default connection string that Cosmos DB supplies contains unescaped characters in the `password` and `appName` so those users are probably going to be running into this issue more. Initial github issue: https://github.com/mongodb-js/compass/issues/2994


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