Skip to content

extensions: add delayed auto-update mode to extensions.autoUpdate - #318974

Merged
Sandeep Somavarapu (sandy081) merged 4 commits into
mainfrom
sandy081/extensions-delayed-auto-update
May 29, 2026
Merged

Sandeep Somavarapu (sandy081) merged 4 commits into
mainfrom
sandy081/extensions-delayed-auto-update

Conversation

@sandy081

@sandy081 Sandeep Somavarapu (sandy081) commented May 29, 2026 •

Copy link
Copy Markdown
Member

What

Folds a 6-hour delayed auto-update mode into the existing extensions.autoUpdate setting. The setting is now a string enum and is policy-controllable.

  • extensions.autoUpdate: 'on' | 'delayed' | 'off' (was a boolean / onlyEnabledExtensions enum)
    • On – enabled extensions update automatically.
    • Delayed – enabled extensions update automatically, but only 6 hours after a new version is published.
    • Off – extensions are not updated automatically.
  • Made the setting policy-controllable via the ExtensionsAutoUpdate policy.

Behavior in delayed mode

  • An extension whose newer version was published less than 6 hours ago is treated as outdated-but-delayed:
    • excluded from auto-update,
    • excluded from the Extensions activity badge,
    • surfaces an info status explaining that it is not yet auto updated and when it will be (relative time, refreshed on hover).
  • Manual updates still work regardless of the delay.
  • The "Enable/Disable Auto Update for All Extensions" actions are hidden when the setting is policy-controlled.

Migration

Startup migration of legacy values plus defensive read-time normalization in getAutoUpdateValue():

  • true / 'all' / 'onlyEnabledExtensions' -> 'on'
  • false / 'none' / 'onlySelectedExtensions' -> 'off'
  • 'delayed' -> 'delayed'

Tests

Added unit tests in extensionsWorkbenchService.test.ts covering getAutoUpdateValue() normalization, isAutoUpdateDelayed() boundaries, and getAutoUpdateDelayRemaining(); updated plugin auto-update/marketplace tests for the new enum values.

Notes for reviewers

  • build/lib/policies/policyData.jsonc still needs to be regenerated via npm run export-policy-data (the ExtensionsAutoUpdate policy enum/enumDescriptions changed) — blocked locally by a corrupted Electron install, so it needs a regen by a codeowner/CI.
  • Validated with compile-check-ts-native, valid-layers-check, and hygiene. Unit tests could not be executed locally (corrupted Electron) but compile clean.

Fixes - https://github.com/microsoft/vscode-internalbacklog/issues/7834, https://github.com/microsoft/vscode-internalbacklog/issues/7769

Folds a 6-hour delayed auto-update mode into the existing
`extensions.autoUpdate` setting, which is now a string enum
('on' | 'delayed' | 'off') and policy-controllable via the
ExtensionsAutoUpdate policy.

When set to 'delayed', an extension whose newer version was published
less than 6 hours ago is treated as outdated-but-delayed: it is excluded
from auto-update and the activity badge, and surfaces an info status
explaining when it will be auto updated. Manual updates still work.

Includes startup migration from legacy values (true/'all'/
'onlyEnabledExtensions' -> 'on'; false/'none'/'onlySelectedExtensions'
-> 'off') plus defensive read-time normalization, and unit tests for the
new logic.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings May 29, 2026 14:10
@sandy081 Sandeep Somavarapu (sandy081) added this to the 1.123.0 milestone May 29, 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 expands extensions.autoUpdate into a policy-controllable string enum to support a new 6-hour delayed auto-update mode, and wires that behavior through the extensions UI and related plugin auto-update logic.

Changes:

  • Replaces extensions.autoUpdate legacy boolean/enum values with 'on' | 'delayed' | 'off', including migration + read-time normalization.
  • Implements delayed auto-update behavior (delay window computation, re-check scheduling, UI badge/status behavior).
  • Updates plugin auto-update/marketplace code and tests to use the new normalized auto-update value.
Show a summary per file
File Description
src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts Adds unit tests for auto-update normalization and delayed-mode boundary behavior.
src/vs/workbench/contrib/extensions/common/extensions.ts Updates the auto-update type and extends the workbench service API to expose delayed-mode helpers.
src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts Implements normalization, delayed window calculation, and delayed re-check scheduling during auto-update.
src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts Recomputes extension status on hover to keep time-relative delayed messaging current.
src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts Excludes delayed-outdated extensions from contributing to the activity badge count.
src/vs/workbench/contrib/extensions/browser/extensionsActions.ts Adapts actions/status computation to new auto-update values and adds delayed status messaging.
src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts Updates configuration schema, adds policy wiring, updates menu visibility conditions, and adds migration.
src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts Stubs IExtensionsWorkbenchService in tests due to new dependency usage.
src/vs/workbench/contrib/chat/test/browser/plugins/pluginAutoUpdate.test.ts Updates plugin auto-update tests for new 'on'/'off'/'delayed' values.
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts Switches auto-update enablement checks to rely on normalized value via IExtensionsWorkbenchService.
src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.ts Uses normalized auto-update value via IExtensionsWorkbenchService instead of direct config reads.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/extensions/common/extensions.ts:201

  • IExtensionsConfiguration.autoUpdate is still typed as boolean, but extensions.autoUpdate is now a string enum ('on' | 'delayed' | 'off'). Keeping this as boolean makes the exported configuration shape incorrect and can lead to wrong typings where this interface is used.
export interface IExtensionsConfiguration {
	autoUpdate: boolean;
	autoCheckUpdates: boolean;
	ignoreRecommendations: boolean;
	closeExtensionDetailsOnViewChange: boolean;
}
  • Files reviewed: 11/11 changed files
  • Comments generated: 4

- Type IExtensionsConfiguration.autoUpdate as AutoUpdateConfigurationValue
- Keep ExtensionStatusAction.update() returning void; add recomputeStatus()
  for callers that need to await the computed status
- Preserve the higher-priority warning CSS class when the delayed info status
  is also applied to an outdated extension
- Hover awaits recomputeStatus() instead of update()
- Update pluginAutoUpdate doc comment to the on/delayed/off enum values

Co-authored-by: Copilot <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants