Repository navigation
PR5: Keep open views bound to their connection identity - #1121
Tomasz Naumowicz (tnaum-ms) merged 45 commits into
Conversation
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>
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>
✅ CI passed: standard tier (ready PR)Commit
Full run: add the Code quality
Build sizeNo size data for Artifacts: VSIX | Bundle-reports-45446504047 | L1-manifest-report-45446504047 All graphs (exact bytes)
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>
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>
There was a problem hiding this comment.
🟡 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
Validate the originating epoch immediately before submitting writes · New Preserve the panel binding when opening collection sessions · New Preserve and verify the source binding through Dashboard copy and paste · New Preserve the submitted document ID across newer draft edits · New Report bound drop failures without replaying the write · New Report and propagate terminal failures while consuming bound exports · New Stop bound imports and report connection failures · New Propagate terminal authentication failures from optional stats reads · New Convert bound transfer and drop startup failures to unavailable errors · New Latch rejected startup credentials for the current epoch · New Suppress the telemetry notification before rethrowing unavailable errors · New Validate the client generation that ran before applying results · New Resolve the original binding before treating an empty cache as cancellation · New Clear stale delete progress when an operation is cancelled · New Mark only unanswered collection reads as interrupted · New Clear interrupted-read marker after a successful retry read · New Clear AI progress state when aborting the generation controller · New Gate import and export handlers through the lifecycle · New Classify startup failures through the session operation wrapper · New Preserve unavailable errors through the recommendations telemetry wrapper · New
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
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>
10952ce
into
feature/connection-lifecycle


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.3and accepted the authentication-change evidence on1.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.