Skip to content

Keep database connections usable across credential expiry and idle timeouts #1102

Open

Description

Problem: A long-running VS Code session should stay usable without a restart or manual reconnect. Investigate separately whether failures come from expired database credentials, an idle connection closed by the server, or an open view holding onto a stale client.

Acceptance criteria

  • For Microsoft Entra ID connections, renew the access token without prompting when possible. When a new database connection is needed, use a valid token rather than reusing an expired one.
  • For standard authentication, reconnect using the configured credential when an idle connection drops. If that credential is no longer valid, prompt the user to update it rather than retrying indefinitely.
  • If interactive sign-in is required, keep open Collection View tabs and preserve query text, filters, sort, projection, and unsaved edits. After reconnecting, those tabs should use the recovered connection.
  • Recover on the next operation without requiring a VS Code restart. Do not silently replay writes whose outcome is unknown.

Test matrix: Cover Azure DocumentDB and Azure Cosmos DB for MongoDB (RU) with standard database credentials and Microsoft Entra ID wherever supported. Mark unsupported backend/auth combinations explicitly. For RU, distinguish signing in to Azure for resource discovery from authenticating to the database. For each supported combination, exercise an idle session and a dropped connection with tabs already open. For Entra ID, also exercise token expiry, silent renewal, and interactive sign-in when silent renewal fails.

Related: #296.

Metadata

Metadata

Labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions