@@ -362,10 +362,9 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
362362 }
363363 const { id, uuid } = extension ? extension . identifier : < IExtensionIdentifier > arg1 ;
364364 let query = new Query ( )
365- . withFlags ( Flags . IncludeAssetUri , Flags . IncludeStatistics , Flags . IncludeFiles , Flags . IncludeVersionProperties , Flags . ExcludeNonValidated )
365+ . withFlags ( Flags . IncludeAssetUri , Flags . IncludeStatistics , Flags . IncludeFiles , Flags . IncludeVersionProperties )
366366 . withPage ( 1 , 1 )
367- . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' )
368- . withFilter ( FilterType . ExcludeWithFlags , flagsToString ( Flags . Unpublished ) ) ;
367+ . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' ) ;
369368
370369 if ( uuid ) {
371370 query = query . withFilter ( FilterType . ExtensionId , uuid ) ;
@@ -426,8 +425,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
426425 let query = new Query ( )
427426 . withFlags ( Flags . IncludeLatestVersionOnly , Flags . IncludeAssetUri , Flags . IncludeStatistics , Flags . IncludeFiles , Flags . IncludeVersionProperties )
428427 . withPage ( 1 , pageSize )
429- . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' )
430- . withFilter ( FilterType . ExcludeWithFlags , flagsToString ( Flags . Unpublished ) ) ;
428+ . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' ) ;
431429
432430 if ( text ) {
433431 // Use category filter instead of "category:themes"
@@ -484,6 +482,11 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
484482 }
485483
486484 private queryGallery ( query : Query , token : CancellationToken ) : Promise < { galleryExtensions : IRawGalleryExtension [ ] , total : number ; } > {
485+ // Always exclude non validated and unpublished extensions
486+ query = query
487+ . withFlags ( query . flags , Flags . ExcludeNonValidated )
488+ . withFilter ( FilterType . ExcludeWithFlags , flagsToString ( Flags . Unpublished ) ) ;
489+
487490 if ( ! this . isEnabled ( ) ) {
488491 return Promise . reject ( new Error ( 'No extension gallery service configured.' ) ) ;
489492 }
@@ -602,10 +605,9 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
602605
603606 getAllVersions ( extension : IGalleryExtension , compatible : boolean ) : Promise < IGalleryExtensionVersion [ ] > {
604607 let query = new Query ( )
605- . withFlags ( Flags . IncludeVersions , Flags . IncludeFiles , Flags . IncludeVersionProperties , Flags . ExcludeNonValidated )
608+ . withFlags ( Flags . IncludeVersions , Flags . IncludeFiles , Flags . IncludeVersionProperties )
606609 . withPage ( 1 , 1 )
607- . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' )
608- . withFilter ( FilterType . ExcludeWithFlags , flagsToString ( Flags . Unpublished ) ) ;
610+ . withFilter ( FilterType . Target , 'Microsoft.VisualStudio.Code' ) ;
609611
610612 if ( extension . identifier . uuid ) {
611613 query = query . withFilter ( FilterType . ExtensionId , extension . identifier . uuid ) ;
0 commit comments