microsoft / microsoft/vscode-documentdb

Unified disconnect/remove connection experience across all views

Open
#566 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

Problem

When a connection is removed via removeConnection, several surfaces are left in a stale state:

  • Playground: UI still shows "connected" status; next execution throws a confusing "No credentials found" error instead of transitioning to the disconnected state
  • Interactive Shell: Shell PTY remains open with a stale connection
  • Collection View: Open collection views may reference the removed connection
  • Document View: Open document views may reference the removed connection
  • Running Tasks: Any active tasks (e.g., export, schema scan) on that connection are not canceled

Currently, removeConnection clears CredentialCache and SchemaStore, but does not notify any of these surfaces.

Proposed Solution

Design a unified disconnect experience that:

  1. Notifies all active views when a connection is removed
  2. Transitions each surface to an appropriate disconnected state (not silently stale)
  3. Optionally cancels running tasks on the removed connection
  4. Considers adding an explicit "Disconnect" command separate from "Remove Connection"

This could be implemented via an event-driven approach (e.g., CredentialCache or a connection manager emitting events) or explicit cleanup calls from removeConnection.

Context

Identified during PR #508 review (Finding H1). The playground specifically has a first-class disconnected state (PlaygroundService.clearConnection()), but it is not called when the connection is removed externally.

Scope

This affects the playground, interactive shell, collection view, document view, and any other surface that holds a reference to a connection.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing removeConnection and the existing CredentialCache and SchemaStore cleanup, then inspect PlaygroundService.clearConnection and the other connection-holding surfaces named in the issue. Define how removal notifications or explicit cleanup reach the playground, shell, collection and document views, and running tasks. Done means every affected surface enters a disconnected state and relevant tasks are handled without stale references.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
desktop, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.