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

Fix WebviewElement::streamToBuffer #142288

Merged
merged 1 commit into from Feb 8, 2022
Merged

Conversation

jeanp413
Copy link
Contributor

@jeanp413 jeanp413 commented Feb 5, 2022

This PR fixes loading webview resources when running vscode server
Related 256cc1d

cc @mjbvz

jeanp413 referenced this pull request Feb 5, 2022
* Use transferables for webview resources

Fixes #139145

This updates the webview resource loading to use transferables

On desktop, this requires a new way of converting the file stream to a buffer without using the nodejs backing pool

* Use ArrayBuffer directly instead of using Buffer
@mjbvz
Copy link
Contributor

mjbvz commented Feb 7, 2022

Have you tested this on ./scripts/code-web.sh too? I think this change is ok but the current code also works fine there for me

@mjbvz mjbvz added this to the February 2022 milestone Feb 7, 2022
@jeanp413
Copy link
Contributor Author

jeanp413 commented Feb 7, 2022

@mjbvz vscode web is not affected as this code path is not executed, resources are loaded from hosting server directly http://localhost:8080/static/sources/extensions/simple-browser/media/codicon.css
For vscode server resources are loaded from through code server itself https://vscode-remote+localhost-003a9888.vscode-resource.vscode-webview.net/home/jeanpierre/gitrepos/vscode/extensions/simple-browser/media/codicon.css

@mjbvz
Copy link
Contributor

mjbvz commented Feb 7, 2022

Using a web client, the current code works on both serverless and when connected to a server

Using a desktop client, it work with local files and connected over ssh to a workspace

What am I missing?

@jeanp413
Copy link
Contributor Author

jeanp413 commented Feb 8, 2022

@mjbvz it's not working when connected to a server, I tested using chrome and firefox in Ubuntu. Here's a gif showing the error (which is silently ignored in the catch clause):
webview_resource_issue

@mjbvz
Copy link
Contributor

mjbvz commented Feb 8, 2022

Ok thanks, yes I see this on Chrome. Not sure why it seems fine on safari in my testing

@mjbvz mjbvz merged commit 0283cec into microsoft:main Feb 8, 2022
@jeanp413 jeanp413 deleted the fix-streamToBuffer branch February 8, 2022 02:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants