Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
247bc68
feat: classify connection failures before deciding how to recover (WI-5)
tnaum-ms Nov 23, 2026
afe4bc2
docs: record CP-2 and retain verified Entra settings for explicit sig…
tnaum-ms Nov 23, 2026
6565f5f
feat: fence authentication recovery to the failed client generation (…
tnaum-ms Nov 23, 2026
7c51541
docs: reuse the existing latch for explicit rejection recovery
tnaum-ms Nov 23, 2026
d441269
feat: recover tree connections through explicit retry and sign-in (WI-5)
tnaum-ms Nov 23, 2026
814debb
docs: record WI-5 verification and the OP-3 candidate
tnaum-ms Nov 23, 2026
cac13fb
fix: show one primary action for Entra tree recovery (WI-5)
tnaum-ms Nov 23, 2026
40a8d54
fix: restore draft CI checks for connection recovery (WI-5)
tnaum-ms Nov 23, 2026
20dcde1
docs: defer prompt Microsoft sign-out handling until after 1.2.0
tnaum-ms Nov 23, 2026
a557fb6
fix: keep VS Code UI imports out of the database worker
tnaum-ms Nov 23, 2026
34929b5
feat: show sanitized extension-host connection stats (WI-5)
tnaum-ms Nov 23, 2026
8864907
feat: show Entra token expiry in connection stats (WI-5)
tnaum-ms Nov 23, 2026
917e2e1
feat: show time remaining on the Entra token (WI-5)
tnaum-ms Nov 23, 2026
98d72dd
chore: identify the next OP-3 test build as 1.1.1-alpha.1
tnaum-ms Nov 23, 2026
ee19ba4
fix: clarify the tree sign-in recovery action (WI-5)
tnaum-ms Nov 23, 2026
69112da
style: format connection diagnostics tests for CI
tnaum-ms Nov 23, 2026
87ab0ed
fix: respect client recovery when reconnecting and retrying (WI-5)
tnaum-ms Nov 23, 2026
1500634
fix: keep stale and inert recovery rows out of the cluster tree (WI-5)
tnaum-ms Nov 23, 2026
64d6f3f
fix: preserve ordinary edits across recovery state changes (WI-5)
tnaum-ms Nov 23, 2026
dcee136
fix: close lint and type-check gaps in PR4 review fixes
tnaum-ms Nov 23, 2026
d422d06
docs: record PR4 review dispositions and verified handoff checks
tnaum-ms Nov 23, 2026
ed21d7c
docs: record operator acceptance of the PR4 worker smoke
tnaum-ms Nov 24, 2026
ca841a7
Merge branch 'feature/connection-lifecycle' into dev/tnaum/connection…
tnaum-ms Nov 24, 2026
27345af
fix: explain Entra provider drift before retrying sign-in (R1)
tnaum-ms Nov 24, 2026
f340718
fix: preserve actionable managed identity guidance (R4)
tnaum-ms Nov 24, 2026
195243c
fix: recover rejected Quick Start credentials through Retry (R6)
tnaum-ms Nov 24, 2026
b1b446e
fix: report foreground database and index expansion failures (R9)
tnaum-ms Nov 24, 2026
228be9f
fix: explain how to repair rejected tree connections (R8)
tnaum-ms Nov 24, 2026
1e55082
chore: regenerate localization and format PR4 review fixes
tnaum-ms Nov 24, 2026
b9099d8
docs: record PR4 inline review dispositions and verification
tnaum-ms Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/ai-and-plans/features/connection-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ code:
- [#1059](https://github.com/microsoft/vscode-documentdb/issues/1059)
- [#566](https://github.com/microsoft/vscode-documentdb/issues/566)
- [#990](https://github.com/microsoft/vscode-documentdb/issues/990)
- follow-up after 1.2.0: [#1105](https://github.com/microsoft/vscode-documentdb/issues/1105) (Kubernetes tunnels, network resilience) and
[#1106](https://github.com/microsoft/vscode-documentdb/issues/1106) (out-of-date results)
- follow-ups after 1.2.0: [#1105](https://github.com/microsoft/vscode-documentdb/issues/1105)
(Kubernetes tunnels, network resilience), [#1106](https://github.com/microsoft/vscode-documentdb/issues/1106)
(out-of-date results), and [#1119](https://github.com/microsoft/vscode-documentdb/issues/1119)
(prompt handling of Microsoft account sign-out)

**Branch:** `feature/connection-lifecycle`, with stacked sub-PRs from `dev/tnaum/*`. Implementation
does not wait for intermediate merges; the operator handles approvals and merges (decision 0006).
Expand Down Expand Up @@ -49,6 +51,9 @@ Evidence, telemetry and source pointers: [research-findings.md](./research-findi
fingerprint and generation.
- **Never change identity under an open surface.** It becomes disconnected, keeps its state, says why
and offers one action.
- After a database rejects a verified Entra identity, discard the client but keep its in-memory
connection settings for explicit sign-in. Do not retain the rejected token or retry silently.
When the tree offers **Retry sign-in**, it does not also offer **Retry**.
- **One teardown** serves Disconnect, Remove Connection and identity-changing credential updates.
- Disconnect uses the existing task-conflict guard: if a copy or export is using the cluster,
leave the task and connection running. The user can retry after the task finishes or is stopped.
Expand Down Expand Up @@ -79,6 +84,8 @@ See [decisions.md](./decisions.md):
- 0011 Disconnect keeps the cached credentials and the verified identity; only Remove drops them;
- 0012 a minimal lifecycle design: no state machine, one epoch, no prompts in `getClient`, one-step teardown;
- 0013 corrections to 0012: latch before a credential save, epoch checks on replies, bindings carried through handoffs, an operation wrapper, folder deletion runs teardown.
- 0014 retain in-memory settings for explicit sign-in recovery after verified Entra rejection.
- 0015 use the existing latch to block startup after authentication rejection until explicit recovery.

## Timeline

Expand Down
55 changes: 40 additions & 15 deletions docs/ai-and-plans/features/connection-lifecycle/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ created: 2026-11-19
> Why connections stay usable across token expiry and idle drops, and how open surfaces behave
> when credentials or the identity change. Evidence: [research-findings.md](./research-findings.md).

| # | Decision | Status | Changed from the proposal? | Date | PR |
| ---- | ---------------------------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------ | ---------- | --- |
| 0001 | Entra tokens are renewed silently in every OIDC callback; the callback never prompts | Accepted | Operator accepted the explanation (2026-11-19) | 2026-11-19 | — |
| 0002 | Keep one cached client per cluster; surfaces resolve it per operation with identity + generation | Accepted (modified by 0010) | Operator position: per-operation clients cost too much | 2026-11-19 | — |
| 0003 | An open surface never moves to a different identity; it becomes disconnected, keeps its state and says why | Accepted | Operator requirement | 2026-11-19 | — |
| 0004 | Disconnect lets the user choose: close all affected tabs, or keep them open and disabled | Accepted | Operator position; the default is still open (Q2) | 2026-11-19 | — |
| 0005 | Fix stale ARM credentials by upgrading azureauth to v6 (#990), not with a local shim | Accepted | Operator: open to updating dependencies | 2026-11-19 | — |
| 0006 | Deliver through `feature/connection-lifecycle` with stacked sub-PRs, ship once | Accepted (amended) | Operator removed the intermediate merge wait | 2026-11-19 | — |
| 0007 | The Disconnect choice is a VS Code modal with nothing remembered; a setting can set the default | Accepted | Operator: modal cannot pre-select; no remembering | 2026-11-19 | — |
| 0008 | Upgrade the azext stack as high as viable without breaking workflows, using Azure Resources as reference | Accepted | Operator: replaces the "minimal versions" proposal | 2026-11-19 | — |
| 0009 | Kubernetes tunnel recovery, cluster ID case handling and wider network-resilience testing move to #1105 | Accepted | Operator: keep 1.2.0 focused; schedule after release | 2026-11-19 | — |
| 0010 | Rely on the server to reject expired tokens; replacing a client for the same identity is transparent | Accepted | Operator: no rotation, no out-of-date notices | 2026-11-19 | — |
| 0011 | Disconnect keeps the cached credentials and the verified identity; only Remove drops them | Accepted | Operator: reverses the #1059 proposal (plan Q3) | 2026-11-19 | — |
| 0012 | Keep the lifecycle design minimal: no state machine, one epoch, no prompts in getClient, one-step teardown | Accepted | Operator: approved every proposed simplification | 2026-11-19 | — |
| 0013 | Correct the minimal design where it lost edits, identity or recovery: latch before save, epoch checks | Accepted (modifies 0012) | Operator: "update the plan" after the omissions review | 2026-11-19 | — |
| # | Decision | Status | Changed from the proposal? | Date | PR |
| ---- | ---------------------------------------------------------------------------------------------------------- | --------------------------- | ----------------------------------------------------------- | ---------- | ---------------------------------------------------------------- |
| 0001 | Entra tokens are renewed silently in every OIDC callback; the callback never prompts | Accepted | Operator accepted the explanation (2026-11-19) | 2026-11-19 | — |
| 0002 | Keep one cached client per cluster; surfaces resolve it per operation with identity + generation | Accepted (modified by 0010) | Operator position: per-operation clients cost too much | 2026-11-19 | — |
| 0003 | An open surface never moves to a different identity; it becomes disconnected, keeps its state and says why | Accepted | Operator requirement | 2026-11-19 | — |
| 0004 | Disconnect lets the user choose: close all affected tabs, or keep them open and disabled | Accepted | Operator position; the default is still open (Q2) | 2026-11-19 | — |
| 0005 | Fix stale ARM credentials by upgrading azureauth to v6 (#990), not with a local shim | Accepted | Operator: open to updating dependencies | 2026-11-19 | — |
| 0006 | Deliver through `feature/connection-lifecycle` with stacked sub-PRs, ship once | Accepted (amended) | Operator removed the intermediate merge wait | 2026-11-19 | — |
| 0007 | The Disconnect choice is a VS Code modal with nothing remembered; a setting can set the default | Accepted | Operator: modal cannot pre-select; no remembering | 2026-11-19 | — |
| 0008 | Upgrade the azext stack as high as viable without breaking workflows, using Azure Resources as reference | Accepted | Operator: replaces the "minimal versions" proposal | 2026-11-19 | — |
| 0009 | Kubernetes tunnel recovery, cluster ID case handling and wider network-resilience testing move to #1105 | Accepted | Operator: keep 1.2.0 focused; schedule after release | 2026-11-19 | — |
| 0010 | Rely on the server to reject expired tokens; replacing a client for the same identity is transparent | Accepted | Operator: no rotation, no out-of-date notices | 2026-11-19 | — |
| 0011 | Disconnect keeps the cached credentials and the verified identity; only Remove drops them | Accepted | Operator: reverses the #1059 proposal (plan Q3) | 2026-11-19 | — |
| 0012 | Keep the lifecycle design minimal: no state machine, one epoch, no prompts in getClient, one-step teardown | Accepted | Operator: approved every proposed simplification | 2026-11-19 | — |
| 0013 | Correct the minimal design where it lost edits, identity or recovery: latch before save, epoch checks | Accepted (modifies 0012) | Operator: "update the plan" after the omissions review | 2026-11-19 | — |
| 0014 | Keep in-memory connection settings after a rejection for a verified Entra identity | Accepted | Operator selected A to make sign-in recovery smoother | 2026-11-23 | Yes; WI-5 previously said to delete the entry |
| 0015 | Use the existing latch to block startup after authentication rejection | Accepted | Operator selected A; keep the approach simple and pragmatic | 2026-11-23 | Yes; expands the existing latch rather than adding a second hold |

> Entries below are **semantically** immutable: append new entries rather than rewriting old ones,
> and record reversals as a new entry plus a status change above. Heading text is frozen once
Expand Down Expand Up @@ -399,3 +401,26 @@ The findings, each confirmed in the code, and the corrections now in the dev pla
submission, no replay, no stale UI update and no claim that an unacknowledged write was not applied.

None of the corrections adds a state machine or a service; 0012's other rules stand.

## 0014. Keep in-memory connection settings after a rejection for a verified Entra identity

A final Entra database authentication rejection still evicts the client. If the connection has a
verified Entra identity, keep its existing in-memory connection settings so **Sign in again** can
start from that identity, including when invoked with only `clusterId`. The operator chose this
over deleting the settings and losing that recovery action, to keep recovery smooth.

This does not retain the rejected token, write anything to persistent storage, change destination
checks, or start a silent retry. Native authentication and RU key handling are unchanged. The
explicit sign-in path still checks the epoch after prompting and never moves an open surface to a
different identity.

## 0015. Use the existing latch to block startup after authentication rejection

Evicting a rejected client is not enough: a subsequent operation could immediately start a new
one with the same settings. Set the existing in-memory latch to `credentialsRejected` before
evicting the rejected generation. The matching explicit recovery can clear that reason only if
the epoch still matches. It cannot clear a latch set by Disconnect, Remove or a credential change.

The operator chose to reuse the existing latch rather than introduce a separate authentication
hold, keeping one place to check for an unavailable connection. The rejection latch uses the
existing epoch and does not add a subscription, new persistence, or a retry loop.
Loading
Loading