Fix extension uninstall state across local and remote servers by thernstig · Pull Request #343171 · microsoft/vscode · GitHub
Skip to content

Fix extension uninstall state across local and remote servers - #343171

Open
Tobias Hernstig (thernstig) wants to merge 2 commits into
microsoft:mainfrom
thernstig:fix/extensions-uninstall-server-state
Open

Tobias Hernstig (thernstig) wants to merge 2 commits into
microsoft:mainfrom
thernstig:fix/extensions-uninstall-server-state

Conversation

@thernstig

Copy link
Copy Markdown
Contributor

Fixes #343155.

When the same Marketplace extension is installed on multiple servers, uninstalling one copy can leave its Uninstall action enabled because the state lookup finds the surviving copy on another server. The per-server lookup now ignores extension models owned by a different server. Models without a server still aggregate state across installations.

The regression tests cover both removal directions for local/remote and web/remote copies, failed uninstall recovery, reinstalling, and serverless Marketplace results. Action tests cover Uninstall and Manage, including extensions applied to all profiles. An existing runtime-state test now fires the completion event connected to its local service and supplies the missing removal stub, so it actually exercises successful uninstall.

All eight new regression tests failed against the original code. With the fix, both complete test files pass: 356 tests passed. Targeted ESLint and editor diagnostics are also clean.

./scripts/test.sh src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts
npm run eslint -- src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts

Validation used the repository's Electron test runner on Linux/WSL with test extension-management services. A manual local/remote UI scenario has not been run.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open issue
What changed in this PR

Fixes incorrect Uninstall/state behavior when the same Marketplace extension exists on multiple extension-management servers by scoping per-server state lookups, and adds regression coverage for local/remote/web combinations and action enablement behavior.

Changes:

  • Scope extension state resolution to the owning server to prevent cross-server “installed” leakage.
  • Add regression tests covering uninstall/reinstall flows across local/remote/web copies, including failure recovery and serverless gallery results.
  • Expand actions/runtime-state tests to validate Uninstall/Manage behavior (including “all profiles”) and correctly fire uninstall completion.
File Description
src/​vs/​workbench/​contrib/​extensions/​browser/​extensionsWorkbenchService.ts Updates getExtensionState to ignore models owned by a different server.
src/​vs/​workbench/​contrib/​extensions/​test/​electron-browser/​extensionsWorkbenchService.test.ts Adds regression matrix tests for scoped state during uninstall/reinstall across servers.
src/​vs/​workbench/​contrib/​extensions/​test/​electron-browser/​extensionsActions.test.ts Adds action-level regression tests and fixes a runtime-state test to actually exercise uninstall completion.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
1 resolved since last review

Review effort: Lite

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
2 resolved since last review

Review effort: Lite

@thernstig

Tobias Hernstig (thernstig) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extensions: Uninstall remains enabled after removing a local or remote copy

3 participants