Skip to content

Streamline update mode configuration and handling#323206

Draft
dmitrivMS wants to merge 7 commits into
mainfrom
dev/dmitriv/update-mode-none
Draft

Streamline update mode configuration and handling#323206
dmitrivMS wants to merge 7 commits into
mainfrom
dev/dmitriv/update-mode-none

Conversation

@dmitrivMS

Copy link
Copy Markdown
Contributor

Fixes #289144

Copilot AI review requested due to automatic review settings June 26, 2026 20:22
@dmitrivMS dmitrivMS self-assigned this Jun 26, 2026

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.

Pull request overview

This PR fixes update.mode: "none" not reliably stopping automatic updates (notably on Windows background updates) by making update-mode changes apply at runtime and ensuring in-flight work is cancelled when updates are disabled.

Changes:

  • Refactors AbstractUpdateService to reconfigure itself on update.mode changes (enable/disable without restart) and to cancel scheduled checks when disabling.
  • Adds Windows-specific cancellation of in-flight check/download chains so disabling updates at runtime prevents reaching the background installer.
  • Updates update.mode setting/policy descriptions to remove the “Requires a restart” claim, and removes restart-on-change handling from the relauncher contribution.
  • Adds unit tests covering startup and runtime transitions for update.mode.
Show a summary per file
File Description
src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts Stops treating update.mode changes as requiring a workbench relaunch.
src/vs/platform/update/test/electron-main/abstractUpdateService.test.ts Adds tests for startup/runtime behavior of update.mode, including cancellation and permanent disablement.
src/vs/platform/update/electron-main/updateService.win32.ts Introduces a cancellation token for the check/download chain and cancels it when updates are disabled at runtime.
src/vs/platform/update/electron-main/updateService.linux.ts Prevents mid-check disablement from flipping state back out of Disabled by ignoring late results/errors.
src/vs/platform/update/electron-main/updateService.darwin.ts Switches raw autoUpdater event subscriptions to use the base Disposable store.
src/vs/platform/update/electron-main/abstractUpdateService.ts Centralizes runtime update-mode reconfiguration, scheduling, and disable/cancel logic.
src/vs/platform/update/common/update.config.contribution.ts Updates configuration/policy descriptions to reflect no-restart behavior for update.mode.

Review details

  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/vs/platform/update/electron-main/abstractUpdateService.ts

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.

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 5
  • Review effort level: Low

Comment thread src/vs/platform/update/test/electron-main/abstractUpdateService.test.ts Outdated
Comment thread src/vs/platform/update/electron-main/abstractUpdateService.ts Outdated
Comment thread src/vs/platform/update/electron-main/abstractUpdateService.ts Outdated
Comment thread src/vs/platform/update/electron-main/updateService.linux.ts

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.

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +492 to +499
protected override async cancelUpdate(): Promise<void> {
// Abort an in-flight check/download so it never reaches the background installer.
this.checkCancellationTokenSource?.dispose(true);
this.checkCancellationTokenSource = undefined;

// Tear down any pending (downloaded/applying) update.
await this.cancelPendingUpdate();
}
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.

Setting update.mode to "none" does not stop automatic updates

2 participants