microsoft / microsoft/vscode-documentdb

Audit and harden cancellable connection attempts

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

Nobody has claimed this yet.

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

Description

Context

PR #848 propagated its task AbortSignal through source and target ClustersClient.getClient calls. ClustersClient already attempts to interrupt a pending MongoClient.connect by closing the underlying client and maps an aborted connection to UserCancelledError.

That shared cancellation behavior has little direct test coverage, and cancellable callers are not systematically audited.

Follow-up

  • Add focused tests for cancellation before a new connection, during a new connection, and during cached-client reconnection.
  • Verify abort-listener cleanup and the connect/abort race around a connection that has just succeeded.
  • Audit interactive ClustersClient.getClient call sites and pass an AbortSignal where the UI or task exposes cancellation.
  • Define consistent cancellation classification across UserCancelledError, AbortError, telemetry, and user-visible errors.
  • Confirm aborting a cached reconnection does not leave the cached client unusable.

Acceptance criteria

  • Shared connection cancellation paths have deterministic unit coverage.
  • Cancellable call sites stop promptly without being reported as failures.
  • Any intentionally non-cancellable call sites are documented.

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 locating ClustersClient.getClient and its source and target callers, then read PR #848 and the UserCancelledError handling around MongoClient.connect. Add deterministic coverage for pre-connect, in-flight, cached reconnection, listener cleanup, and the connect/abort race; audit interactive callers and document intentionally non-cancellable ones. Done means cancellation is prompt, consistently classified, and does not corrupt cached clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
developer-experience, testing, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.