Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Addresses review feedback from PR #478 to improve code clarity in the storage service initialization flow.

Changes:

  • Pass Storage as parameter to fixFolderConnectionStrings() and cleanupDuplicateConnectionStringParameters() instead of calling getStorageService() internally
  • Obtain storage service once in resolvePostMigrationErrors() and pass to both cleanup methods
  • Clarify test comment to specify that setTimeout waits for the fire-and-forget cleanupOrphanedItems(), not the awaited cleanup methods

Before:

private static async cleanupDuplicateConnectionStringParameters(context: IActionContext): Promise<void> {
    for (const connectionType of [ConnectionType.Clusters, ConnectionType.Emulators]) {
        const storageService = await this.getStorageService();  // Called during initialization - appears circular
        const items = await storageService.getItems<StoredItemProperties>(connectionType);
        // ...
    }
}

After:

private static async resolvePostMigrationErrors(): Promise<void> {
    const storageService = await this.getStorageService();  // Obtained once
    await this.fixFolderConnectionStrings(context, storageService);
    await this.cleanupDuplicateConnectionStringParameters(context, storageService);
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tnaum-ms <171359267+tnaum-ms@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-documentdb/vscode-documentdb/node_modules/.bin/vscode-test connectionStorageService.cleanup.test.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add deduplication methods for connection string parameters refactor: eliminate circular getStorageService() calls in cleanup methods Feb 3, 2026
Copilot AI requested a review from tnaum-ms February 3, 2026 09:27
@tnaum-ms tnaum-ms marked this pull request as ready for review February 3, 2026 09:58
@tnaum-ms tnaum-ms requested a review from a team as a code owner February 3, 2026 09:58
@tnaum-ms tnaum-ms merged commit 976193a into dev/tnaum/defensive-connection-string-handling-duplicate-parameters Feb 3, 2026
2 checks passed
@tnaum-ms tnaum-ms deleted the copilot/sub-pr-478 branch February 3, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants