- Notifications
You must be signed in to change notification settings - Fork35
Commit99d1fab
authored
Unify deployment tracking and support multiple deployments (#677)
This change centralizes deployment state management and enables seamlessmulti-deployment support. The extension now properly tracksper-deployment credentials, syncs state across VS Code windows, andhandles login/logout flows in a unified way.Key changes:Architecture:- Add `DeploymentManager` to centralize deployment state (`url`,`label`, `token`, `user`) and coordinate extension client updates, authcontexts, and workspace refreshes- Add `LoginCoordinator` to handle login prompts with cross-windowdetection, preventing duplicate login dialogs when multiple windows needauthStorage & Auth:- `SecretsManager` now stores per-deployment credentials usinglabel-based keys (`coder.session.<label>`) instead of flat`sessionToken` storage- Add LRU tracking for deployments with automatic cleanup of oldcredentials- Add migration from legacy flat storage format- Cross-window sync via `secrets.onDidChange` events- Debug command (`coder.debug.listDeployments`) for inspecting storedstateCommands & Remote:- Commands now use `DeploymentManager` instead of directly manipulatingclient- Remote connection uses `LoginCoordinator` for auth prompts duringworkspace connections- `CliManager.configure()` now called on every remote connection, withsecrets storage as the source of truth for credentialsWebSocket improvements:- `CoderApi` now implements Disposable to clean up WebSocket connections- Add `setCredentials()` method to update host+token atomically,avoiding unnecessary reconnection cycles- Add `disconnect()` support to `ReconnectingWebSocket` for cleandisconnects- Simplify WebSocket fallback logic with cleaner SSE fallback handlingTests:- Update `secretsManager` tests for new per-deployment API- Add comprehensive `reconnectingWebSocket` tests for disconnect/reconnect- Extend `coderApi` tests for credential handling1 parent5ef523f commit99d1fab
File tree
30 files changed
+3191
-1046
lines changed- src
- api
- core
- deployment
- login
- remote
- websocket
- test
- mocks
- unit
- api
- core
- deployment
- login
- websocket
30 files changed
+3191
-1046
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
| |||
0 commit comments
Comments
(0)