Skip to content

Simplify connection recovery and end retained sessions safely - #1149

Merged
Tomasz Naumowicz (tnaum-ms) merged 63 commits into
feature/connection-lifecyclefrom
dev/tnaum/connection-lifecycle-simplification
Dec 1, 2026
Merged

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

Conversation

@tnaum-ms

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

Copy link
Copy Markdown
Collaborator

What changed

Keep the same tab usable through token expiry, dropped sockets and same-account sign-in repair, without a separate Retry-to-unlock step or automatic operation replay.

Explicit Disconnect, Remove and Disconnect-before-update end the old session permanently. Kept tabs remain read-only; X dismisses only their notice for copying. Reconnecting opens fresh views. Connection edits use ordinary teardown first, and delayed commands, query generation and Playground/Shell handoffs cannot adopt a replacement connection.

Why and scope

Implements approved package P and decisions 0030–0032. This is stacked on feature/connection-lifecycle, not main, as part of #1136. Related: #1102, #1059 and #566.

Preserves physical-client recovery, worker account pins, startup cancellation, active-transfer guards, dirty-content protection and visible partial-save failures. It does not add multi-identity rebinding, revive explicitly disconnected tabs or broaden network/tunnel recovery.

Manual-test feedback follow-ups

  • Both Update Credentials and Update Connection String explain: “You can only update credentials or the connection string while disconnected.”
  • Close view closes a disconnected Dashboard, Collection View or clean Document View directly. A dirty Document View still warns and allows cancellation.
  • Playground’s CodeLens, status bar and information action reflect explicit Disconnect immediately, without needing a failed Run first. The selected connection/file contents are retained, and the execution guard remains unchanged.
  • The new subscription mock in the TDD: CollectionNameCache fixture was updated with explicit operator approval; every behavior assertion is unchanged.

Validation

  • Follow-up Case 1 passed: npm run build; 587 focused tests across 25 files. Earlier integrated coverage also passed 1,157 tests and 47 browser-manifest tests. Manifest tests validate fixtures, not rendered behavior.
  • Case 2 passed after the final follow-up push on f8da433c084d298bdecfe09a8003408dd7dcd708:
    • npm run l10n
    • npm run prettier-fix
    • npm run l10n:check
    • npm run lint
    • npm run build
    • npm run typecheck:tests — strict package-test type checks passed separately.
    • npx vitest run — 459/459 files passed; 10,501 passed, 1 skipped, no failures.
    • npm run package
    • All commands exited 0; local/remote HEAD match and the tracked worktree is clean.
    • Test fixture and typing issues were repaired without weakening any behavior assertions.
  • Rendered webview scenarios: attempted; default Document View layout passed in three themes, but lifecycle scenarios hit readiness/Monaco/held-reply and Dashboard-status mismatches. Those lifecycle assertions are not verified and remain a workbench/rendered gate, separate from passing host unit tests.
  • Full CI passed on the matching final head: run 46524982328. All PR head checks completed without failures. Earlier-head results are not represented as final-head evidence.

Candidate for manual testing

  • Commit: f8da433c084d298bdecfe09a8003408dd7dcd708.
  • VSIX: vscode-documentdb-1.1.1-alpha.4.vsix, version 1.1.1-alpha.4, 9,269,838 bytes.
  • SHA-256: 683b89d8155c6a8bbd067ad84b44cce6c95787613e474e3c5857d9af7cc1fcd6.
  • Built by the successful final Case 2 run on the clean, pushed candidate. Packaging alone is not a live authentication or expiry pass.

This PR intentionally remains draft. Pending manual checks do not prevent publication or Case 2 execution, but they are not waived and are not represented as passed.

Manual tests still pending

The implementation handoff and detailed A–H runbook contains prerequisites, ordered steps, pass/fail/uncertain criteria and a copyable result template.

  • Isolated profile with the exact candidate VSIX, commit and SHA-256; authorized disposable Entra target.
  • Continuous use for about 90 minutes across real expiry, including Shell and Playground; no background interactive prompt or automatic replay.
  • A separate session idle for at least two hours with retryWrites=false: Save is the first database operation, with no warm-up read; preserve the draft and inspect actual submission/server effects.
  • Genuine physical sleep/wake across expiry on a dedicated machine, separately from the continuous and idle runs.
  • Same-account tree sign-in repair followed by one explicit operation in the same tab; a wrong account must not repair it.
  • Disconnect/Remove/edit Close–Keep–Cancel and dirty/active-transfer matrix; old views cause zero replacement-connection writes while equivalent fresh-view actions succeed.
  • Shell/Playground text preservation and retained-link behavior; deterministic held-reply races are covered by host tests, not claimed as manual coverage.
  • Matching packaged activation receipt and authorized telemetry-ingestion evidence, not merely local emission.

Authorized live infrastructure and a dedicated sleep/wake environment are unavailable to the agent. Each applicable live/workbench result remains NOT RUN / blocked until evidence is returned for the identified candidate.

Design and evidence

Final AI pre-review/author decisions and required live evidence remain readiness gates; per-item advisor reviews do not imply those gates passed.

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>
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 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ CI passed: standard tier (ready PR)

Commit fd20185, 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.
Last full run: ✅ passed on f8da433, requested by Tomasz Naumowicz (@tnaum-ms), run.

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-46756927245 | L1-manifest-report-46756927245

All graphs (exact bytes)
Graph PR bytes
Collection View page (collectionView) 6,070,663
Document View page (documentView) 4,838,066
Local Quick Start page (localQuickStart) 1,603,701
Atlas Credentials page (atlasCredentials) 1,532,367
Cluster Dashboard page (clusterDashboard) 1,581,881
Diagnose Connection page (connectionDiagnostics) 1,555,282
Activation (mainStartup) 3,248,811
Extension host (main) 9,826,125
Playground worker (playgroundWorker) 5,417,400
VSIX (vsix) 9,273,331
playgroundTsPlugin 6,175
viewsEntry 1,479,794
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) added the ci:full-requested Requests a full run of CI checks. label Nov 30, 2026
@github-actions github-actions Bot removed the ci:full-requested Requests a full run of CI checks. label Nov 30, 2026
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>
The existing bounded connectionFailureKind now reports signInRequired for an Entra account mismatch, preserving the binding until explicit sign-in recovery instead of evicting or replaying it. An actual identity change remains terminal.

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>
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) marked this pull request as ready for review December 1, 2026 22:10
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) merged commit d872792 into feature/connection-lifecycle Dec 1, 2026
13 of 23 checks passed
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) deleted the dev/tnaum/connection-lifecycle-simplification branch December 1, 2026 22:16
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