Skip to content

PR5: Keep open views bound to their connection identity - #1121

Merged
Tomasz Naumowicz (tnaum-ms) merged 45 commits into
feature/connection-lifecyclefrom
dev/tnaum/connection-lifecycle-bound-surfaces
Nov 24, 2026
Merged

Tomasz Naumowicz (tnaum-ms) merged 45 commits into
feature/connection-lifecyclefrom
dev/tnaum/connection-lifecycle-bound-surfaces

Conversation

@tnaum-ms

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

Copy link
Copy Markdown
Collaborator

What changed

Collection View, Document View, and Cluster Dashboard stay bound to the identity that opened them. Views can follow a replacement client for that identity, but never silently switch to another. A Fluent dialog dims an unavailable view without discarding its current query, draft, or results. Retry does not replay the failed operation. X only dismisses the dialog so users can copy existing contents; trying a database action brings the dialog back. Close view requires native confirmation and warns about unsaved edits.

Bound file transfers and Dashboard namespace commands keep the originating identity through pickers and confirmations. Paste Collection remains available from the tree. Interrupted reads and writes preserve verified results without showing stale progress or automatically replaying the operation.

Scope and validation

Credential repair stays in the connection tree. Task leases, Disconnect/Remove, Dashboard polling, and permanently locking old views after a saved connection edit (decision 0018) remain WI-7/WI-8 work. This PR includes merged PR4 (#1117).

Case 2 passed: formatting, localization check, lint, build, strict workspace test type-check, full Vitest (9,863 passed, one skipped), and VSIX packaging. See the pre-review and dispositions.

OP-4 cleared: the operator verified silent Entra renewal with an open view on 1.1.1-alpha.3 and accepted the authentication-change evidence on 1.1.1-alpha.2. The old same-user password recovery check was waived, not run. OP-5 covers Disconnect/Remove behavior and the new saved-edit lock.

Part of #1102. See WI-6.

Post-merge description review

For 1.2.0, the retained-view Retry flow and unconditional Close view confirmation described above were superseded by #1149 and #1169. Recoverable failures can leave a tab usable with the same connection identity; work is never replayed automatically. If Disconnect, deletion, or a connection edit ends the session, a kept tab stays copyable but permanently read-only: open a new tab after reconnecting. Close view prompts before discarding an unsaved document, not for every tab.

Give planned teardown a cluster-scoped list without introducing shared surface state or changing panel behavior yet.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the existing startup fingerprint guard and return typed startup rejections before sending operations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve clients per operation and fence cache writes without changing procedure responses yet.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reuse the existing Fluent warning block and polite live region with one explicit recovery action.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record decision 0016 and keep the view mounted and inert until an explicit recovery or close action.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep bindings on the host and fence stale operations without changing React response shapes in this slice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep unrepairable views open in the disabled state and offer only explicit Close.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…WI-6)

Keep recovery explicit, preserve the current identity on dismissal, and prevent an older action from clearing a removal latch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show the unavailable overlay over retained inventory, suspend submissions while disabled, and rebind only through explicit recovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the bound identity after the file picker, and keep a bound import on the same client across batches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…(WI-6)

Use one host binding across tabs, fence stale replies, and carry the initiating binding into transfer commands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use Fluent’s modal backdrop and focus handling, clarify Close view, and verify disconnected queries and late replies in the browser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from dev/tnaum/connection-lifecycle-recovery to feature/connection-lifecycle November 24, 2026 11:32
Keep credential repair in the tree and present the approved Fluent dialog with a short status, next-step detail, and side-by-side actions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Distinguish the identity-bound view candidate from the PR4 worker smoke package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms Tomasz Naumowicz (tnaum-ms) added the ci:full-requested Requests a full run of CI checks. label Nov 24, 2026
@github-actions github-actions Bot removed the ci:full-requested Requests a full run of CI checks. label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ CI passed: standard tier (ready PR)

Commit 35153c5, workflow run.

Layer Result Ran or skipped because
Static checks ✅ passed every push
Unit tests ✅ passed every push
npm packages: verify tarballs ✅ passed packages/**, package-lock.json or the CI workflow changed
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 ✅ passed packages/vscode-ext-webview/**, package-lock.json or the CI workflow changed
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: ❌ failed on 9853022, 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-45446504047 | L1-manifest-report-45446504047

All graphs (exact bytes)
Graph PR bytes
Collection View page (collectionView) 6,058,764
Document View page (documentView) 4,826,406
Local Quick Start page (localQuickStart) 1,592,699
Atlas Credentials page (atlasCredentials) 1,521,365
Cluster Dashboard page (clusterDashboard) 1,570,200
Diagnose Connection page (connectionDiagnostics) 1,544,280
Activation (mainStartup) 3,198,628
Extension host (main) 9,775,220
Playground worker (playgroundWorker) 5,415,042
VSIX (vsix) 9,255,093
playgroundTsPlugin 6,175
viewsEntry 1,468,792
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.

Dismiss only the overlay with the Fluent close control, preserve identity guards on further operations, and confirm before disposing the tab.

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 the ci:full-requested Requests a full run of CI checks. label Nov 24, 2026
@github-actions github-actions Bot removed the ci:full-requested Requests a full run of CI checks. label Nov 24, 2026
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) marked this pull request as ready for review November 24, 2026 13:09
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) marked this pull request as draft November 24, 2026 13:10
@tnaum-ms Tomasz Naumowicz (tnaum-ms) added this to the 1.2.0 milestone Nov 24, 2026
Record the OP-4 operator override, regenerate localization, and resolve the draft CI formatting and type-aware lint findings without changing the approved recovery flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 can cross connection identities, execute deletes after invalidation, and insert duplicate documents when edits overlap a save.

21 open issues

And 1 more that still need to be addressed.

What changed in this PR

Extends PR4’s connection recovery work so Collection View, Document View, and Cluster Dashboard remain tied to their originating connection identity while preserving existing contents during interruptions.

Changes:

  • Adds bound client resolution and carries connection identity through view and command handoffs.
  • Introduces unavailable-state dialogs with explicit Retry, dismissal, and confirmed Close view actions.
  • Adds interruption handling, regression tests, browser harness support, localization, and design documentation.
File Description
src/​webviews/​documentdb/​documentView/​documentView.test.tsx Tests draft preservation and save identity reuse.
src/​webviews/​documentdb/​documentView/​documentsViewRouter.ts Binds document reads and saves to connection identity.
src/​webviews/​documentdb/​documentView/​documentsViewRouter.test.ts Tests bound operations and unavailable responses.
src/​webviews/​documentdb/​documentView/​documentsViewController.ts Registers the document surface and recovery actions.
src/​webviews/​documentdb/​documentView/​documentsViewController.test.ts Tests surface registration and identity-safe recovery.
src/​webviews/​documentdb/​collectionView/​types/​queryInsightsStream.ts Adds unavailable events to analysis streams.
src/​webviews/​documentdb/​collectionView/​queryInsightsTab/​QueryInsightsTab.tsx Guards analysis requests and handles interruptions.
src/​webviews/​documentdb/​collectionView/​queryInsightsTab/​components/​queryPlanSummary/​QueryPlanSummary.tsx Guards raw execution-stat actions.
src/​webviews/​documentdb/​collectionView/​queryInsightsReducer.ts Adds interrupted early-stage transitions.
src/​webviews/​documentdb/​collectionView/​queryInsightsReducer.stage3Phase.test.ts Tests interrupted analysis state preservation.
src/​webviews/​documentdb/​collectionView/​queryInsights/​queryInsightsEventsRouter.ts Adds bound startup checks and unavailable stream responses.
src/​webviews/​documentdb/​collectionView/​indexesTab/​components/​indexList/​IndexRowDetails.tsx Guards raw index-definition actions.
src/​webviews/​documentdb/​collectionView/​components/​toolbar/​CollectionQueryActionBar.tsx Adds lifecycle guards to query actions.
src/​webviews/​documentdb/​collectionView/​components/​queryEditor/​QueryEditor.tsx Ignores stale AI replies after interruption.
src/​webviews/​documentdb/​collectionView/​collectionViewRouter.test.ts Tests unavailable queries and captured transfer bindings.
src/​webviews/​documentdb/​collectionView/​collectionViewController.ts Registers Collection View recovery and disable handling.
src/​webviews/​documentdb/​collectionView/​collectionViewController.test.ts Tests bound recovery without query replay.
src/​webviews/​documentdb/​collectionView/​collectionViewContext.ts Defines lifecycle controls and cancelled analysis states.
src/​webviews/​documentdb/​clusterDashboard/​components/​useDatabaseCollections.ts Tracks interrupted inventory reads and retained results.
src/​webviews/​documentdb/​clusterDashboard/​components/​InventoryPanel.tsx Guards navigation and distinguishes interrupted inventory.
src/​webviews/​documentdb/​clusterDashboard/​components/​InventoryPanel.test.ts Tests interrupted inventory empty states.
src/​webviews/​documentdb/​clusterDashboard/​clusterDashboardRouter.test.ts Tests bound polling, commands, and terminal failures.
src/​webviews/​documentdb/​clusterDashboard/​clusterDashboardController.ts Binds native row actions and registers dashboard recovery.
src/​webviews/​documentdb/​clusterDashboard/​clusterDashboardContextMenu.ts Removes the Dashboard Paste command identifier.
src/​webviews/​documentdb/​boundViewOperations.ts Centralizes bound operation guards and recovery.
src/​webviews/​components/​DisconnectedOverlay.tsx Adds the unavailable dialog and close confirmation.
src/​webviews/​components/​DisconnectedOverlay.test.tsx Tests dismissal, confirmation, and retained drafts.
src/​webviews/​components/​DisconnectedOverlay.scss Styles the unavailable dialog.
src/​webviews/​_integration/​describeUnavailableConnection.ts Maps connection failures to localized recovery guidance.
src/​webviews/​_integration/​describeUnavailableConnection.test.ts Tests recovery guidance and action availability.
src/​webviews/​_integration/​connectionUnavailable.ts Defines shared unavailable and recovery messages.
src/​services/​ai/​QueryInsightsAIService.ts Uses bound sessions for index recommendation actions.
src/​documentdb/​utils/​getClusterHealth.ts Exposes collector errors for connection classification.
src/​documentdb/​runWithClient.ts Uses bound resolution and authentication-aware classification.
src/​documentdb/​resolveTransferClient.ts Resolves transfers against their originating identity.
src/​documentdb/​connectionSurfaces.ts Adds a registry of open connection-bound surfaces.
src/​documentdb/​connectionSurfaces.test.ts Tests scoped registration and disposal.
src/​documentdb/​ClustersClient.ts Adds identity-constrained client acquisition.
src/​documentdb/​ClustersClient.test.ts Tests replacement clients, stale replies, and write safety.
src/​commands/​runBoundNamespaceCommand.ts Adds classified execution for bound namespace commands.
src/​commands/​rethrowBoundCommandUnavailable.ts Propagates unavailable failures through command wrappers.
src/​commands/​openDocument/​openDocument.ts Captures the binding when opening Document View.
src/​commands/​openClusterDashboard/​openClusterDashboard.ts Passes the connected client’s binding to the Dashboard.
src/​commands/​llmEnhancedCommands/​indexAdvisorCommands.ts Binds AI preparation to session identity and epoch.
src/​commands/​importDocuments/​importDocuments.ts Carries bindings through file selection and import batches.
src/​commands/​importDocuments/​importDocuments.test.ts Tests identity changes during file selection.
src/​commands/​exportDocuments/​exportDocuments.ts Resolves exports using an optional originating binding.
src/​commands/​deleteDatabase/​deleteDatabase.ts Resolves bound deletion after confirmation.
src/​commands/​deleteCollection/​deleteCollection.ts Adds binding-aware collection deletion.
src/​commands/​dashboardBoundCommands.test.ts Tests command bindings across prompts and confirmations.
src/​commands/​createDatabase/​ExecuteStep.ts Uses bound execution for database creation.
src/​commands/​createDatabase/​DatabaseNameStep.ts Binds database-name validation reads.
src/​commands/​createDatabase/​CreateDatabaseWizardContext.ts Carries the database wizard’s connection binding.
src/​commands/​createDatabase/​createDatabase.ts Threads bindings and propagates unavailable wizard failures.
src/​commands/​createCollection/​ExecuteStep.ts Uses bound execution for collection creation.
src/​commands/​createCollection/​CreateCollectionWizardContext.ts Carries the collection wizard’s connection binding.
src/​commands/​createCollection/​createCollection.ts Threads bindings through collection creation.
src/​commands/​createCollection/​CollectionNameStep.ts Binds collection-name validation reads.
src/​commands/​copyReference/​copyReference.ts Supports copying retained namespace references without tree lookup.
package.json Removes Dashboard Paste contributions and updates the prerelease version.
package-lock.json Aligns root package version metadata.
l10n/​bundle.l10n.json Adds unavailable-state and recovery strings.
docs/​ai-and-plans/​features/​connection-lifecycle/​README.md Updates intended unavailable-view behavior.
docs/​ai-and-plans/​features/​connection-lifecycle/​iterations/​01-pr5-bound-surfaces-review.md Records pre-review findings, dispositions, and validation.
docs/​ai-and-plans/​features/​connection-lifecycle/​iterations/​01-implementation-plan.md Updates overlay requirements and operator scenarios.
docs/​ai-and-plans/​features/​connection-lifecycle/​decisions.md Records unavailable-view and saved-edit policy decisions.
build/​verification/​browser/​scenarios.test.ts Updates expected browser scenario counts.
build/​verification/​browser/​scenario-playwright.ts Adds message injection, held replies, and editor interactions.
build/​verification/​browser/​fixtures.ts Adjusts fixture helper typing for staged replies.
build/​verification/​browser/​core/​fixtures.ts Defines held replies and subsequent response fixtures.
build/​verification/​browser/​core/​fakeVsCodeApi.ts Implements delayed replies and cancellation cleanup.
build/​verification/​browser/​core.test.ts Tests held-reply release and aborted-request removal.

Review effort: Max

Comment thread src/documentdb/resolveTransferClient.ts Resolved
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>
… R20)

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>
…5 R16)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s (PR5 R4)

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>
Reuse the existing import count translation and tidy the document regression fixture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the delete callback typed without altering when the bound or tree client is resolved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) merged commit 10952ce into feature/connection-lifecycle Nov 24, 2026
12 checks passed
@tnaum-ms
Tomasz Naumowicz (tnaum-ms) deleted the dev/tnaum/connection-lifecycle-bound-surfaces branch November 24, 2026 17:23
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.

3 participants