Skip to content

Refine connection lifecycle recovery UX - #1146

Merged
Tomasz Naumowicz (tnaum-ms) merged 51 commits into
feature/connection-lifecyclefrom
dev/tnaum/connection-lifecycle-ux
Nov 27, 2026
Merged

Tomasz Naumowicz (tnaum-ms) merged 51 commits into
feature/connection-lifecyclefrom
dev/tnaum/connection-lifecycle-ux

Conversation

@tnaum-ms

@tnaum-ms Tomasz Naumowicz (tnaum-ms) commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Refine connection-lifecycle recovery across tree actions, retained views, the Interactive Shell and Query Playground without changing bound identities or replaying failed database operations.

  • Keep Retry failure feedback in the retained-view dialog, with Retry stable throughout the unavailable episode.
  • Offer a separate unauthenticated diagnostic Shell from failure rows. Preserve local completion/history while excluding authenticated shared metadata and saved-authentication fallback.
  • Explain genuinely failed stale recovery actions on their intended surface; keep cancellation and obsolete work quiet.
  • Correct worker rerun guidance, separate Shell disconnect output from input, clarify retained-content/password copy, and unify readable debug statistics.

Scope and decisions

This is a dedicated follow-up to #1136, targeting feature/connection-lifecycle.
Operator decisions and rejected alternatives are recorded in the feature and its iteration 2 implementation record.

Descendant-expansion feedback is deferred to #1143 until foreground attribution is supported. F7 remains pending an operator reproduction; no speculative menu fix is included.

The main-branch worktree lint exclusion was ported independently, without unrelated dependency or feature changes.

Validation

All eight Case 2 commands ran and passed after addressing failures:
l10n, prettier-fix, l10n:check, lint, build, typecheck:tests, full Vitest, and package.

  • Full runtime suite: 449 files passed; 10,205 tests passed, 1 skipped.
  • After scoped lint fixes: targeted lint, 63 focused tests, final default-heap lint, build and packaging passed.
  • Worktree-exclusion regression and ported-file formatting checks passed.
  • Source browser verification: 24 unique routes passed across dark, light and high contrast; 47 static scenario tests passed.

Still draft

The Section 6 AI pre-review file for this UX round is not committed. No readiness for human review is claimed.

Manual checks remain: real-terminal disconnect with idle/partial/wrapped/multiline/evaluating input; F7 credential repair and the refreshed Disconnect menu; and screen-reader announcements after failed Retry. Source/browser and unit checks do not replace those live checks.

Post-merge description review

The retained-view Retry behavior above was an intermediate design, superseded by #1149 and #1169. Recoverable failures do not require a separate in-view Retry to unlock a tab. When the old session has ended, the tab instead shows Session ended: you can copy its contents, but must open a new tab to resume database work. The separate unauthenticated Shell remains available for diagnostics without reusing saved credentials or authenticated shared metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip nested Git checkouts so type-aware ESLint checks only the current workspace without exhausting its heap. Keep untracked source in scope and cover both checkout directions with a regression test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit f38e028)
Preserve view identifiers and error/redaction test behavior while correcting lint-visible types and synchronous awaits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms Tomasz Naumowicz (tnaum-ms) added this to the 1.2.0 milestone Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ CI passed: standard tier (ready PR)

Commit 209a162, workflow run.

Layer Result Ran or skipped because
Static checks ✅ passed every push
Unit tests ✅ passed every push
npm packages: verify tarballs ⏭️ skipped no change to packages/**, package-lock.json or the CI workflow
VSIX: inspect contents ✅ passed ready PR
VSIX: self-test of the checks ✅ passed build/verification/**, build/vite/**, the Vite configs, package-lock.json or the CI workflow changed
VSIX: activate in VS Code ✅ passed ready PR
VSIX: self-test of the activation check ✅ passed build/verification/**, build/vite/**, the Vite configs, package-lock.json or the CI workflow changed
Webview host in unbundled extensions ⏭️ skipped no change to packages/vscode-ext-webview/**, package-lock.json or the CI workflow
E2E ⏭️ not available yet arrives with the E2E iteration (full tier)

Full run: add the ci:full-requested label to run every layer once on the current commit.
No full run yet.

Code quality

Check Status How to fix
Localization (l10n) ✅ Passed Nothing to fix
ESLint ✅ Passed Nothing to fix
Prettier formatting ✅ Passed Nothing to fix

Build size

No size data for feature/connection-lifecycle yet; sizes only. VSIX: 8.8 MiB.

Artifacts: VSIX | Bundle-reports-46049379306 | L1-manifest-report-46049379306

All graphs (exact bytes)
Graph PR bytes
Collection View page (collectionView) 6,059,719
Document View page (documentView) 4,827,468
Local Quick Start page (localQuickStart) 1,592,279
Atlas Credentials page (atlasCredentials) 1,520,945
Cluster Dashboard page (clusterDashboard) 1,571,447
Diagnose Connection page (connectionDiagnostics) 1,543,860
Activation (mainStartup) 3,243,016
Extension host (main) 9,819,604
Playground worker (playgroundWorker) 5,417,400
VSIX (vsix) 9,268,145
playgroundTsPlugin 6,175
viewsEntry 1,468,372
viewsAssets 80,340
editorWorker 259,570
jsonWorker 389,427

Packaged bytes. Shared chunks count in every graph that loads them, so rows do not add up.

Updated in place on every run.

@tnaum-ms
Tomasz Naumowicz (tnaum-ms) marked this pull request as ready for review November 27, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical defects block diagnostic Shell startup under authentication holds and can direct Azure VM diagnostic sessions to the wrong port, potentially reaching a different database.

12 open issues
What changed in this PR

Refines connection-lifecycle recovery in the DocumentDB extension for Visual Studio Code as a focused follow-up to #1136, preserving original connection bindings and avoiding automatic operation replay. Descendant-expansion feedback remains deferred to #1143.

Changes:

  • Keeps Retry available throughout retained-view unavailability and displays failed-attempt feedback inside the dialog.
  • Introduces a separate unauthenticated diagnostic Shell and refines tree, Shell, and Playground recovery feedback.
  • Updates debug statistics, localization, documentation, regression coverage, and nested-checkout lint exclusions.
File Description
src/​webviews/​documentdb/​useBoundViewRecovery.ts Tracks persistent Retry availability and in-view failures.
src/​webviews/​documentdb/​useBoundViewRecovery.test.tsx Covers Retry episodes and obsolete responses.
src/​webviews/​documentdb/​documentView/​documentView.tsx Connects Document View to updated recovery state.
src/​webviews/​documentdb/​collectionView/​CollectionView.tsx Connects Collection View to updated recovery state.
src/​webviews/​documentdb/​clusterDashboard/​ClusterDashboard.tsx Connects Dashboard to updated recovery state.
src/​webviews/​components/​DisconnectedOverlay.tsx Displays Retry failures and retains recovery controls.
src/​webviews/​components/​DisconnectedOverlay.test.tsx Covers alerts, controls, and retained content.
src/​utils/​commandErrorHandling.ts Separates tree-modal and webview-notification feedback.
src/​utils/​commandErrorHandling.test.ts Covers command feedback routing and cancellation.
src/​tree/​documentdb/​ClusterItemBase.ts Adds endpoint access and diagnostic Shell recovery action.
src/​tree/​documentdb/​ClusterItemBase.test.ts Covers endpoint reads and revised recovery rows.
src/​tree/​connections-view/​DocumentDBClusterItem.ts Reads stored endpoints and clarifies password-save copy.
src/​tree/​connections-view/​DocumentDBClusterItem.test.ts Covers stored endpoints and dismissed password updates.
src/​tree/​connections-view/​ConnectionsBranchDataProvider.test.ts Updates expected recovery action labels and IDs.
src/​documentdb/​shell/​unauthenticatedEndpoint.ts Strips authentication material from diagnostic endpoints.
src/​documentdb/​shell/​unauthenticatedEndpoint.test.ts Covers sanitization, TLS preservation, and bounded errors.
src/​documentdb/​shell/​ShellSessionManager.ts Adds anonymous-session initialization and lifecycle checks.
src/​documentdb/​shell/​ShellSessionManager.test.ts Covers anonymous isolation and lifecycle boundaries.
src/​documentdb/​shell/​ShellCompletionProvider.ts Makes shared metadata access optional.
src/​documentdb/​shell/​ShellCompletionProvider.test.ts Covers metadata-free local completions.
src/​documentdb/​shell/​DocumentDBShellPty.ts Refines anonymous behavior, disconnect output, and recovery guidance.
src/​documentdb/​shell/​DocumentDBShellPty.test.ts Covers isolation, disconnect rendering, and stale sign-in actions.
src/​documentdb/​connectionTeardown.ts Simplifies the Keep open label.
src/​documentdb/​connectionTeardown.test.ts Updates teardown label expectations.
src/​documentdb/​ClustersExtension.ts Registers the diagnostic Shell command.
src/​commands/​signInAgain/​signInAgain.ts Adds bounded feedback for stale tree sign-in actions.
src/​commands/​signInAgain/​signInAgain.test.ts Covers stale sign-in routing and quiet supersession.
src/​commands/​showWorkerStats/​showWorkerStats.ts Standardizes readable worker statistics.
src/​commands/​showWorkerStats/​showWorkerStats.test.ts Covers formatting and restricted diagnostic fields.
src/​commands/​showConnectionStats/​showConnectionStats.ts Separates connection statistics into readable fields.
src/​commands/​showConnectionStats/​showConnectionStats.test.ts Covers lifecycle facts, units, and output boundaries.
src/​commands/​retryAuthentication/​retryAuthentication.ts Refreshes and explains stale Retry actions.
src/​commands/​retryAuthentication/​retryAuthentication.test.ts Covers superseded reads, closes, and cancellation.
src/​commands/​playground/​executePlaygroundCode.ts Refines rerun guidance and stale sign-in feedback.
src/​commands/​playground/​executePlaygroundCode.test.ts Covers lifecycle guidance and obsolete recovery actions.
src/​commands/​openInteractiveShell/​openInteractiveShell.ts Adds the unauthenticated Shell entry point.
src/​commands/​openInteractiveShell/​openInteractiveShell.test.ts Covers endpoint sanitization and startup guards.
src/​commands/​disconnect/​disconnect.ts Refreshes and explains stale Disconnect/Reconnect actions.
src/​commands/​disconnect/​disconnect.test.ts Covers stable identity and stale-action handling.
l10n/​bundle.l10n.json Updates localized recovery and diagnostic Shell strings.
eslint.config.mjs Excludes nested Git checkouts from lint traversal.
docs/​user-manual/​diagnose-connection.md Updates the diagnostic Shell recovery label.
docs/​user-manual/​connecting-to-databases.md Documents diagnostic Shell isolation and persistent Retry.
docs/​release-notes/​1.2.md Updates the Keep open wording.
docs/​ai-and-plans/​features/​connection-lifecycle/​README.md Records recovery policies and deferred expansion scope.
docs/​ai-and-plans/​features/​connection-lifecycle/​decisions.md Records authentication, feedback, and stale-action decisions.
CONTRIBUTING.md Documents lint behavior for nested checkouts.
CHANGELOG.md Aligns teardown wording with the revised label.
build/​verification/​eslint-worktrees.test.cjs Covers current-checkout versus nested-checkout linting.
build/​verification/​browser/​scenarios.ts Updates the recovery-dialog dismissal selector.
build/​verification/​browser/​fixtures.ts Adds the Document View dirty-report response.
.github/​skills/​tree-cluster-architecture/​SKILL.md Documents diagnostic Shell identity and isolation boundaries.
.github/​skills/​error-translation/​SKILL.md Documents diagnostic Shell feedback ownership.

Review effort: Max

Comment thread src/tree/documentdb/ClusterItemBase.ts Resolved
Comment thread src/commands/signInAgain/signInAgain.ts Resolved
Comment thread src/utils/commandErrorHandling.ts Resolved
Preserve the operator selections and per-thread reporting policy before the lead implementation run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply all nine accepted fixes; preserve C05/C10/C12 no-code decisions and the superseded deferral history.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Define explicit interfaces and non-overlapping worker ownership for all nine accepted fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not warn a newly re-picked document about removal or changes to its previous connection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Distinguish session dismissal from internal stale acquisition without changing identity or startup guards.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep implementation outcomes separate from code commits and identify local-only commit references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass an explicit host-only capability instead of inferring authorization from NoAuth; retain all lifecycle and epoch fences.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture the strict ordinary-session and lifecycle invariants verified by the advisor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Track exact error presentation ownership without treating SDK suppression as proof of feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document one-modal integration coverage and retained error presentation invariants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain the sanitized attempted port and fail closed when unknown instead of falling back to discovery defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh supported nodes and use proven removed or changed reasons without guessing from epoch-only churn.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve normal Shell notifications while enforcing the diagnostic terminal-only feedback policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the sanitizer rework rationale and explicit local-only delivery status.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the user editing position across Disconnect using the existing wrap-aware renderer without replaying input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture intentional wrapped-output assertions and the remaining C09 render-origin check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reuse the existing prompt-width origin reset instead of introducing a new input API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve operator-selected won’t-fix decisions without resolving discussions or changing code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate feedback from the live prompt, preserve cursor and multiline state, and defer output while evaluation owns the terminal.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture all nine local fixes, twelve individual thread outcomes, Case 1 verification, pending live checks, and measured model-role usage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply the required repository formatter separately from code and verification fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a typed rejection mock and throwing cleanup helper while retaining error identity and modal-count coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture the eight check results, preserved C11 fixture coverage, publishing authorization, and measured follow-up usage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) merged commit 0b81b3a into feature/connection-lifecycle Nov 27, 2026
12 checks passed
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) deleted the dev/tnaum/connection-lifecycle-ux branch November 27, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants