fix scanning and updating built in extensions enabled with auto updates#308756
Merged
fix scanning and updating built in extensions enabled with auto updates#308756
Conversation
Contributor
There was a problem hiding this comment.
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
IExtensionInfowithcurrentVersionand 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
AbstractExtensionGalleryServicebehavior changed (e.g.currentVersion/LATEST_IS_OUTDATEDhandling 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
removeStaleAutoUpdateBuiltinExtensionscomputesstaleExtensionsfromscanAllUserExtensions(), 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
lszomoru
approved these changes
Apr 9, 2026
joshspicer
pushed a commit
that referenced
this pull request
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.