Skip to content

fix scanning and updating built in extensions enabled with auto updates#308756

Merged
sandy081 merged 1 commit intomainfrom
sandy081/dramatic-ostrich
Apr 9, 2026
Merged

fix scanning and updating built in extensions enabled with auto updates#308756
sandy081 merged 1 commit intomainfrom
sandy081/dramatic-ostrich

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Apr 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 9, 2026 11:07
@sandy081 sandy081 enabled auto-merge (squash) April 9, 2026 11:07
@sandy081 sandy081 self-assigned this Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adjusts how built-in extensions that are “enabled with auto updates” are scanned, deduplicated, and checked against the Marketplace, shifting from product-version (major/minor) gating toward version comparisons against the actually installed/bundled extension versions.

Changes:

  • Extend IExtensionInfo with currentVersion and pass it from the workbench when checking for updates so gallery resolution can avoid unnecessary query fallback when the gallery “latest” is older than what’s already installed.
  • Update extension scanning/deduping rules for auto-update built-ins (prefer latest user version, remove prior product major/minor compatibility filtering, refine staleness detection in cleanup).
  • Update and remove tests to reflect the new behaviors (scanner tests updated; gallery auto-update suite removed).
Show a summary per file
File Description
src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts Adds currentVersion to extension update queries.
src/vs/platform/extensionManagement/common/extensionManagement.ts Extends IExtensionInfo with currentVersion.
src/vs/platform/extensionManagement/common/extensionGalleryService.ts Uses currentVersion to detect “latest is outdated” and removes major/minor locking logic for auto-update built-ins.
src/vs/platform/extensionManagement/common/extensionsScannerService.ts Adjusts dedup/filtering for auto-update built-ins and changes forceAutoUpdate membership lookup.
src/vs/platform/extensionManagement/node/extensionManagementService.ts Changes stale auto-update builtin cleanup to compare user vs bundled versions.
src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts Updates stubs and expectations for new scanner behavior.
src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts Removes the auto-update built-in gallery compatibility test suite.
src/vs/base/common/product.ts Makes builtInExtensionsEnabledWithAutoUpdates required on product configuration.

Copilot's findings

Comments suppressed due to low confidence (2)

src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts:464

  • The suite that exercised auto-update builtin extension compatibility logic was removed entirely. Since AbstractExtensionGalleryService behavior changed (e.g. currentVersion/LATEST_IS_OUTDATED handling and removal of major/minor locking), it would be good to keep coverage by updating these tests to the new rules rather than deleting them outright.
	});
});



src/vs/platform/extensionManagement/node/extensionManagementService.ts:956

  • removeStaleAutoUpdateBuiltinExtensions computes staleExtensions from scanAllUserExtensions(), which can return multiple versions of the same extension (including versions not referenced by the default profile). Removing from the profile by identifier (removeExtensionsFromProfile(staleExtensions.map(e => e.identifier), ...)) can therefore drop the extension from the profile even if the profile currently points at a newer/non-stale version. Consider basing staleness on the extensions actually present in the default profile (e.g. scanUserExtensions({ profileLocation: defaultProfile.extensionsResource, includeInvalid: true })) or deduping to the effective version before removing identifiers from the profile.
		const builtinExtensions = await this.extensionsScannerService.scanSystemExtensions({});
		const userExtensions = await this.extensionsScannerService.scanAllUserExtensions();
		const staleExtensions = userExtensions.filter(userExtension => {
			if (!this.productService.builtInExtensionsEnabledWithAutoUpdates.some(id => id.toLowerCase() === userExtension.identifier.id.toLowerCase())) {
				return false;
			}
			const builtinExtension = builtinExtensions.find(e => areSameExtensions(e.identifier, userExtension.identifier));
			return builtinExtension && semver.lt(userExtension.manifest.version, builtinExtension.manifest.version);
		});
		if (staleExtensions.length) {
			this.logService.info('Removing stale auto-update builtin extensions:', staleExtensions.map(e => `${e.identifier.id}@${e.manifest.version}`).join(', '));
			await this.extensionsProfileScannerService.removeExtensionsFromProfile(staleExtensions.map(e => e.identifier), this.userDataProfilesService.defaultProfile.extensionsResource);
			await Promise.allSettled(staleExtensions.map(e => this.deleteExtension(e, 'stale auto-update builtin')));
  • Files reviewed: 8/8 changed files
  • Comments generated: 3

@sandy081 sandy081 merged commit 7f503b8 into main Apr 9, 2026
27 checks passed
@sandy081 sandy081 deleted the sandy081/dramatic-ostrich branch April 9, 2026 12:35
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 9, 2026
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.

3 participants