Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code query response is listing files in node_modules #456

Closed
jeanp413 opened this issue May 20, 2022 · 6 comments
Closed

VS Code query response is listing files in node_modules #456

jeanp413 opened this issue May 20, 2022 · 6 comments

Comments

@jeanp413
Copy link
Contributor

VS Code makes this query to fetch the popular extensions view but the response is 19 MB

curl 'http://localhost:8080/vscode/gallery/extensionquery' \
  -H 'accept: application/json;api-version=3.0-preview.1' \
  -H 'content-type: application/json' \
  --data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":4,"sortOrder":0}],"assetTypes":[],"flags":950}' \
  --compressed

The response is listing all the files in the node_modules folder of the extension 😬

{
  "assetType": "Microsoft.VisualStudio.Code.WebResources/extension/out/client/node_modules/linebreak.js.map",
  "source": "http://localhost:8080/api/ms-python/python/2019.10.44104/file/extension/out/client/node_modules/linebreak.js.map"
},
{
  "assetType": "Microsoft.VisualStudio.Code.WebResources/extension/out/client/node_modules/node-stream-zip.js",
  "source": "http://localhost:8080/api/ms-python/python/2019.10.44104/file/extension/out/client/node_modules/node-stream-zip.js"
},
{
  "assetType": "Microsoft.VisualStudio.Code.WebResources/extension/out/client/node_modules/node-stream-zip.js.map",
  "source": "http://localhost:8080/api/ms-python/python/2019.10.44104/file/extension/out/client/node_modules/node-stream-zip.js.map"
},
{
  "assetType": "Microsoft.VisualStudio.Code.WebResources/extension/out/client/node_modules/onigasm/lib/onigasm.wasm",
  "source": "http://localhost:8080/api/ms-python/python/2019.10.44104/file/extension/out/client/node_modules/onigasm/lib/onigasm.wasm"
},
{
  "assetType": "Microsoft.VisualStudio.Code.WebResources/extension/out/client/node_modules/pdfkit.js",
  "source": "http://localhost:8080/api/ms-python/python/2019.10.44104/file/extension/out/client/node_modules/pdfkit.js"
},
@jeanp413
Copy link
Contributor Author

cc @amvanbaren

@amvanbaren
Copy link
Contributor

It looks like the MS marketplace doesn't include any WebResources in the response.

curl --location --request POST 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json;api-version=3.0-preview.1' \
--data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":4,"sortOrder":0}],"assetTypes":[],"flags":950}'

Also when I narrow down the query to ms-python.python it doesn't include WebResources

curl --location --request POST 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json;api-version=3.0-preview.1' \
--data-raw '{"filters":[{"criteria":[{"filterType":7,"value":"ms-python.python"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":4,"sortOrder":0}],"assetTypes":[],"flags":950}'

@jeanp413
Copy link
Contributor Author

Seems Microsoft.VisualStudio.Code.WebResources is a custom attribute from openvsx, I don't see it in VSCode source code

@jeanp413
Copy link
Contributor Author

I think we can delete it after #435 is running in production and gitpod-io/openvscode-server#331 is merged and deployed too

amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 9, 2022
- Use Hibernate lazy loading
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 9, 2022
- Use Hibernate lazy loading
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 9, 2022
- Use Hibernate lazy loading
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 18, 2022
- Use Hibernate lazy loading
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
- Added ehcache
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 23, 2022
- Use Hibernate lazy loading
- Add missing @transactional annotations
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
- Added ehcache
- Fix /vscode/unpkg endpoint
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 23, 2022
- Use Hibernate lazy loading
- Add missing @transactional annotations
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
- Added ehcache
- Fix /vscode/unpkg endpoint
amvanbaren added a commit to amvanbaren/openvsx that referenced this issue Aug 23, 2022
- Use Hibernate lazy loading
- Add missing @transactional annotations
- Use @Cacheable instead of in-memory cache
- Remove WebResources from `/vscode/gallery/extensionquery` response, related to eclipse#456
- Get file URLs in bulk
- Added ehcache
- Fix /vscode/unpkg endpoint
@amvanbaren
Copy link
Contributor

@jeanp413 When I run

curl 'https://open-vsx.org/vscode/gallery/extensionquery' \
  -H 'accept: application/json;api-version=3.0-preview.1' \
  -H 'content-type: application/json' \
  --data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":4,"sortOrder":0}],"assetTypes":[],"flags":950}' \
  --compressed

the response no longer contains web resources.
extensionquery.json.txt

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

No branches or pull requests

2 participants