Repository navigation
PR4: Classify connection failures and add explicit recovery - #1117
Tomasz Naumowicz (tnaum-ms) merged 30 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n-in Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…WI-5) 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>
✅ CI passed: standard tier (ready PR)Commit
Full run: add the Code quality
Build sizeNo size data for Artifacts: VSIX | Bundle-reports-45382994173 | L1-manifest-report-45382994173 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. |
Repair the lifecycle test fixtures and type-only import, then update the generated localization and formatting reported by CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record the partial OP-3 evidence and track prompt sign-out handling in #1119 without changing the existing gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate the shared auth IDs from host-only UI metadata so workers can load OIDC options in Node. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose a read-only snapshot for operators without changing the existing OP-3 candidate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show the declared expiry of the last token supplied to the driver without retaining the token or changing renewal. 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>
Record the OP-3 pass and use Retry sign-in as the primary Entra recovery action without changing its command or position. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hold current verified Entra replacement rejections and leave a healthy replacement alone when an old Retry action is clicked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop listings from a different identity, keep actionable repairs, and detect failures without mistaking a database name for a recovery row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Ready for operator review — |
…-lifecycle-recovery
There was a problem hiding this comment.
🟡 Changes recommended
Authentication recovery gaps can leave connections blocked without usable repair actions or repeatedly reopening clients with rejected credentials.
9 open issues
Handle authentication provider drift during recovery · New Hold rejected Native credentials and enable repair · New Mark the previous binding when replacement requires sign-in · New Preserve Managed Identity details in wrapped token errors · New Add established-client context to Discovery child fetches · New Restore Quick Start after a credential rejection · New Suppress successful completion events for discarded failures · New Explain credential rejection and available repair actions · New Report expansion failures and expose cluster recovery · New
What changed in this PR
This PR adds the host and tree recovery layer for #1102: classify connection failures and require explicit recovery where needed, without replaying failed operations. Open-view recovery remains in stacked PR5 (#1121).
Changes:
- Classifies sign-in, credential, closed-client and network failures, with safeguards against stale recovery.
- Adds Retry sign-in and credential/key recovery paths while retaining verified Entra settings.
- Adds sanitized connection statistics, worker-safe authentication identifiers, regression tests and updated design records.
| File | Description |
|---|---|
src/tree/documentdb/ClusterItemBase.ts |
Classifies expansion failures and selects recovery actions. |
src/tree/documentdb/ClusterItemBase.test.ts |
Tests recovery actions and stale identity results. |
src/tree/connections-view/LocalQuickStart/LocalQuickStartItem.ts |
Forwards client-reuse tracking through Quick Start. |
src/tree/connections-view/LocalQuickStart/LocalQuickStartItem.credentials.test.ts |
Updates lifecycle mocks. |
src/tree/connections-view/DocumentDBClusterItem.ts |
Applies classified startup cleanup and epoch checks. |
src/tree/connections-view/DocumentDBClusterItem.test.ts |
Tests credential retention after transient failure. |
src/tree/BaseExtendedTreeDataProvider.ts |
Captures established-client telemetry before expansion. |
src/tree/azure-resources-view/mongo-ru/RUCoreResourceItem.ts |
Exposes key refresh and shared failure cleanup. |
src/tree/azure-resources-view/documentdb/VCoreResourceItem.ts |
Uses shared startup-failure handling. |
src/tree/azure-resources-view/documentdb/azureResourceAuthentication.test.ts |
Updates authentication lifecycle mocks. |
src/plugins/service-kubernetes/discovery-tree/documentdb/KubernetesResourceItem.ts |
Uses epoch-aware startup cleanup. |
src/plugins/service-kubernetes/discovery-tree/documentdb/KubernetesResourceItem.test.ts |
Updates lifecycle mocks. |
src/plugins/service-azure-vm/discovery-tree/vm/AzureVMResourceItem.ts |
Uses shared startup-failure handling. |
src/plugins/service-azure-mongo-vcore/discovery-tree/documentdb/DocumentDBResourceItem.ts |
Applies classified startup cleanup. |
src/plugins/service-azure-mongo-ru/discovery-tree/documentdb/MongoRUResourceItem.ts |
Exposes replacement-key reads and shared cleanup. |
src/plugins/service-atlas-mongodb/discovery-tree/AtlasClusterItem.ts |
Uses shared startup-failure handling. |
src/plugins/service-atlas-mongodb/discovery-tree/AtlasClusterItem.test.ts |
Updates lifecycle mocks. |
src/documentdb/runWithClient.ts |
Adds a bound operation wrapper without replay. |
src/documentdb/connectionFailures.ts |
Defines bounded, typed failure classification. |
src/documentdb/connectionFailures.test.ts |
Tests classification, mixed evidence and cancellation. |
src/documentdb/ClustersExtension.ts |
Registers sign-in recovery and connection statistics. |
src/documentdb/ClustersClient.ts |
Adds failure reporting, recovery holds and diagnostics. |
src/documentdb/ClustersClient.test.ts |
Tests replacement, rejection, diagnostics and recovery races. |
src/documentdb/auth/oidcClientOptions.ts |
Wraps token callback failures for classification. |
src/documentdb/auth/oidcClientOptions.test.ts |
Guards against VS Code imports in workers. |
src/documentdb/auth/MicrosoftEntraIDAuthHandler.ts |
Supports explicit recovery-session acquisition. |
src/documentdb/auth/ManagedIdentityAuthHandler.ts |
Identifies Managed Identity callback failures. |
src/documentdb/auth/ManagedIdentityAuthHandler.test.ts |
Tests wrapped callback failures and explanations. |
src/documentdb/auth/entraErrors/entraCallbackErrors.ts |
Adds worker-safe, auth-specific callback errors. |
src/documentdb/auth/driverOidcContract.test.ts |
Tests final authentication rejection behavior. |
src/documentdb/auth/AuthMethodId.ts |
Extracts authentication identifiers from UI code. |
src/documentdb/auth/AuthMethod.ts |
Re-exports the extracted identifiers. |
src/commands/updateCredentials/UpdateCredentialsWizardContext.ts |
Tracks recovery validity and completed saves. |
src/commands/updateCredentials/updateCredentials.ts |
Checks recovery epochs and clears matching rejection holds. |
src/commands/updateCredentials/updateCredentials.test.ts |
Tests ordinary saves across epoch changes. |
src/commands/updateCredentials/ExecuteStep.ts |
Checks recovery validity around credential persistence. |
src/commands/updateConnectionString/UpdateCSWizardContext.ts |
Adds recovery-validity tracking. |
src/commands/updateConnectionString/updateConnectionString.ts |
Supports rejection recovery with epoch checks. |
src/commands/updateConnectionString/updateConnectionString.test.ts |
Tests ordinary edits across epoch changes. |
src/commands/updateConnectionString/ExecuteStep.ts |
Checks recovery validity around connection-string saves. |
src/commands/signInAgain/signInAgain.ts |
Implements explicit, identity-aware sign-in recovery. |
src/commands/signInAgain/signInAgain.test.ts |
Tests account selection, dismissal and stale recovery. |
src/commands/showConnectionStats/showConnectionStats.ts |
Prints sanitized client state and token expiry. |
src/commands/showConnectionStats/showConnectionStats.test.ts |
Tests expiry and remaining-time formatting. |
src/commands/retryAuthentication/retryAuthentication.ts |
Adds source-specific credential and key recovery. |
src/commands/retryAuthentication/retryAuthentication.test.ts |
Tests key refresh, rejection holds and stale Retry. |
src/commands/diagnoseConnection/diagnoseConnection.test.ts |
Updates lifecycle mocks. |
package.nls.json |
Adds the connection-statistics command title. |
package.json |
Contributes the command and advances the alpha version. |
package-lock.json |
Synchronizes root package version metadata. |
l10n/bundle.l10n.json |
Regenerates recovery messages and removes obsolete strings. |
docs/ai-and-plans/features/connection-lifecycle/README.md |
Summarizes recovery decisions and follow-up scope. |
docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr4-connection-recovery-review.md |
Records pre-review dispositions and validation. |
docs/ai-and-plans/features/connection-lifecycle/iterations/01-implementation-plan.md |
Documents verified Entra rejection recovery. |
docs/ai-and-plans/features/connection-lifecycle/iterations/01-dev-plan.md |
Updates delivery scope and verification progress. |
docs/ai-and-plans/features/connection-lifecycle/decisions.md |
Records settings retention and rejection-hold decisions. |
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>
|
#sign-off |
779efc9
into
feature/connection-lifecycle

What changed
Connection failures now distinguish a lost Entra session, rejected credentials, a closed client, and a temporary network outage. Recovery does not replay the failed operation. The tree offers Retry sign-in instead of Retry when interactive Entra sign-in is needed. A rejected verified Entra connection keeps its in-memory settings but cannot silently reopen.
Show Connection Stats reports sanitized client state and the last Entra token's declared expiry and time remaining. Shell and Playground no longer import VS Code UI code from the Node worker.
Validation and scope
OP-3 passed on the earlier CI VSIX: real sign-out, no unsolicited prompt, explicit prompt dismissal, and successful sign-in on a later click. The operator also confirmed that both Shell and Playground work on the CI-built 1.1.1-alpha.1 VSIX.
Final local Case 2 passed: localization, formatting, lint, build, strict workspace test type-check, 9,796 runtime tests (one skipped), and VSIX packaging. Full CI passed at code head
d422d065b;ed21d7c16only records the operator's smoke confirmation. See the signed-off pre-review.WI-6 webview recovery is not included; it is being developed in stacked PR5 (#1121). Part of #1102. The delivery plan records the remaining work.