Closed jeanp413 closed 2 years ago
Seems 500 error is related to this issue #426
Also from this result I found that the publisher.displayname is null
Yes, publisher.displayName
is not set.
https://github.com/eclipse/openvsx/blob/f475efa0495393d6b71cb5512b5a4392afce2115/server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAdapter.java#L363-L365
It looks like some extensions have a displayName
that is different than publisherName
(namespace name).
Winnie Lin: https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade
While for other extensions the displayName
is the same as the publisherName
.
codingyu: https://marketplace.visualstudio.com/items?itemName=codingyu.laravel-goto-view
I can add queryExt.publisher.displayName = namespace.getName();
as a quick fix.
Seems 500 error is related to this issue #426
Yes, I'll finish up issue #426.
The 404 error is new, I'll try to replicate the issue.
I replicated the 404 error for https://open-vsx.org/vscode/asset/viper-admin/viper/2.4.0/Microsoft.VisualStudio.Code.WebResources/extension/package.json
The viper extension is not a web extension and therefore webresources aren't extracted from the vsix package. https://github.com/eclipse/openvsx/blob/f475efa0495393d6b71cb5512b5a4392afce2115/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java#L301-L302
@jeanp413 Did the Open VSX API return this url in a JSON response or was the url constructed by another app (VS Code, Gitpod)?
A fail-safe way to get the package.json: https://open-vsx.org/vscode/asset/viper-admin/viper/2.4.0/Microsoft.VisualStudio.Code.Manifest
@amvanbaren the extension is returned as part of this query but it doesn't have web resources in the response, I searched for in MS marketplace and it also doesn't have web resources, so it seems vscode asumes all the extensions returned by this query are web extensions and openvsx is filtering incorrectly when doing a search
curl 'https://open-vsx.org/vscode/gallery/extensionquery' \
-H 'content-type: application/json' \
--data-raw '{"filters":[{"criteria":[{"filterType":5,"value":"themes"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":40,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}' \
--compressed
I see the viper extension response from openvsx contains this properties and the response from MS marketplace doesn't, if these properties are used when filtering, then this is causing the issue
{
"key": "Microsoft.VisualStudio.Services.Branding.Color",
"value": "",
},
{
"key": "Microsoft.VisualStudio.Services.Branding.Theme",
"value": "",
},
I'm also seeing some missing resources like "assetType": "Microsoft.VisualStudio.Services.VsixManifest",
and assetType: "Microsoft.VisualStudio.Services.Icons.Small"
and properties like "key": "Microsoft.VisualStudio.Services.Links.Getstarted"
, "key": "Microsoft.VisualStudio.Services.Links.Support"
, etc
The 404 errors are caused by the resourceUrlTemplate
configuration in openvscode-server product.json.
It uses the Open VSX webresource endpoint: https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}
. Not all extensions are web extensions, which cause the 404 errors.
https://github.com/gitpod-io/openvscode-server/blob/8cfe967898b16877f9b0745dd83438459d743c44/product.json#L740-L746
The resourceUrlTemplate
is loaded by extensionResourceLoader. It's then used by workbenchThemeService by calling extensionResourceLoader.getExtensionGalleryResourceURL()
MS VS Code uses https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}
as resourceUrlTemplate
. The endpoint lets you browse through the extension package. If {path}
points to a file then the file contents are returned, else a JSON array of paths is returned (similar to the ls
command on Linux). To try it out: https://viper-admin.vscode-unpkg.net/viper-admin/viper/2.4.0/
I see, thanks for the investigation @amvanbaren :pray:. So this should still be fixed in openvsx right? as trying to access https://open-vsx.org/vscode/asset/viper-admin/viper/2.4.0/
shows an error:
So this should still be fixed in openvsx right?
Yes, I've added a /vscode/unpkg/{namespace}/{extension}/{version}/{path}
endpoint to VSCodeAdapter.
I've changed ExtensionProcessor to always get all resources from a vsix package.
The main challenge is to write a database migration that re-processes all extension versions to get all resources from its vsix package. Flyway offers Java migrations besides SQL scripts, so it is possible.
This package.json urls return 404
Also this theme json resources return error 500
This is the query to get the above extensions, this query is used in vscode when previewing themes directly from marketplace
Also from this result I found that the
publisher.displayname
is null, this is required for the quickpick list descriptionYou can also repro 404 errors when previewing product icon themes
cc @amvanbaren @filiptronicek