Skip to content

Commit

Permalink
simpler recovery fix for #237551 (#237578)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 authored Jan 9, 2025
1 parent 5a932a6 commit 6eef1e2
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
version: this.productService.version,
date: this.productService.date
}
}, false);
}, undefined, extensionInfo.preRelease ? 'prerelease' : 'release');

if (extension) {
result.push(extension);
Expand Down Expand Up @@ -990,7 +990,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
if (hasAllVersions) {
const extensions: IGalleryExtension[] = [];
for (const rawGalleryExtension of rawGalleryExtensions) {
const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, true, context);
const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, context);
if (extension) {
extensions.push(extension);
}
Expand Down Expand Up @@ -1019,7 +1019,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
continue;
}
}
const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, false, context);
const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, context);
if (!extension
/** Need all versions if the extension is a pre-release version but
* - the query is to look for a release version or
Expand Down Expand Up @@ -1060,7 +1060,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
return { extensions: result.sort((a, b) => a[0] - b[0]).map(([, extension]) => extension), total };
}

private async toGalleryExtensionWithCriteria(rawGalleryExtension: IRawGalleryExtension, criteria: IExtensionCriteria, hasAllVersions: boolean, queryContext?: IStringDictionary<any>): Promise<IGalleryExtension | null> {
private async toGalleryExtensionWithCriteria(rawGalleryExtension: IRawGalleryExtension, criteria: IExtensionCriteria, queryContext?: IStringDictionary<any>, versionType?: 'release' | 'prerelease' | 'any'): Promise<IGalleryExtension | null> {

const extensionIdentifier = { id: getGalleryExtensionId(rawGalleryExtension.publisher.publisherName, rawGalleryExtension.extensionName), uuid: rawGalleryExtension.extensionId };
const version = criteria.versions?.find(extensionIdentifierWithVersion => areSameExtensions(extensionIdentifierWithVersion, extensionIdentifier))?.version;
Expand All @@ -1082,7 +1082,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
extensionIdentifier.id,
rawGalleryExtensionVersion,
rawGalleryExtension.publisher.displayName,
includePreRelease ? (hasAllVersions ? 'any' : 'prerelease') : 'release',
versionType ?? (includePreRelease ? 'any' : 'release'),
criteria.compatible,
allTargetPlatforms,
criteria.targetPlatform,
Expand Down

0 comments on commit 6eef1e2

Please sign in to comment.