microsoft / microsoft/vscode-mssql

[Bug]: repository-specific settings.json mssql.connections creates race condition in connectionconfig.ts

Open
#22,468 1 comment 0 reactions 0 assignees View on GitHub
Area - Connection Bug User-filed
Dominant language
TypeScript
Stars
1.9k
Forks
610
Avg merge
2d 3h
Merged PRs (30d)
97

Description

### Description

The logic in connectionconfig.ts does not contemplate repository-specific .vscode/settings.json collection for mssql.connections.

### Steps to Reproduce

1. Create a github repository
2. `cd` to repo root
3. Add a `/.vscode/settings.json` file referencing SQLServer localdb:
```json
{
"mssql.connections": [
{
"profileName": "Dev-Local-MyDatabase-DB",
"server": "(localdb)\\MSSQLLocalDB",
"database": "MyDatabase_UnitTest",
"authenticationType": "Integrated",
"encrypt": true,
"trustServerCertificate": true,
"groupId": "ROOT",
"id": "0d0d3598-0ea9-4140-bddf-f517300a9f7e"
}
]
}
```
4. Observe it tries to add and remove ad inifinitum; the entries progressively dupe more and more over time, due to race conditions in add/remove/update connection logic in connectionconfig.ts

### Affected Area

- [x] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query editor
- [ ] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [x] Other (please describe below)

### If you selected "Other", please describe the affected area

connectionconfig.ts uses promises to determine how to write to, remove, and add connections based on profiles. Those connection profiles do not contemplate repository-specific .vscode/settings.json values, and as a result, the connections dialog continuously loops and adds and removes duplicate entries ad infinitum.

https://github.com/microsoft/vscode-mssql/blob/fd7676b78f09319ca469335bd4fc21c97df9e44d/extensions/mssql/src/connectionconfig/connectionconfig.ts#L248-L271

### Environment Information

Version: 1.127.0 (system setup)
Commit: 4fe60c8b1cdac1c4c174f2fb180d0d758272d713
Date: 2026-06-30T10:52:33+02:00
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Windows_NT x64 10.0.26200

MSSQL Extension Version:
Installation
Identifier
ms-mssql.mssql
Version
1.43.0
Last Updated
4 weeks ago
Size
307.94MB
Cache
26.05KB

### Confirmation

- [x] I have searched existing issues and couldn't find a match
- [x] I want to work on this issue

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in extensions/mssql/src/connectionconfig/connectionconfig.ts, especially the linked promise logic around lines 248-271, and reproduce the issue with a repository-specific .vscode/settings.json containing mssql.connections. Trace how profile-based add, remove, and update operations handle workspace settings. Done means the connection dialog no longer loops or accumulates duplicate entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
database, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.