microsoft / microsoft/vscode-documentdb
Audit and harden cancellable connection attempts
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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