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

Che Theia Web View doesn't work properly when a plugin is running in its own sidecar #16870

Closed
1 task done
azatsarynnyy opened this issue May 7, 2020 · 9 comments
Closed
1 task done
Assignees
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@azatsarynnyy
Copy link
Member

azatsarynnyy commented May 7, 2020

Describe the bug

Che Theia Web View doesn't work properly when a plugin is running in its own sidecar.

Steps to reproduce

  1. Start a Workspace with the following plugin descriptor:
apiVersion: v2
publisher: redhat
name: vscode-didact
version: 0.1.14
type: VS Code extension
displayName: YAML
title: Didact Tutorial Tools by Red Hat
description: Provides interactive tutorial support to Visual Studio Code, via didact links calling VS Code commands, Markdown, AsciiDoc, and the VS Code webview.
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: https://github.com/redhat-developer/vscode-didact
category: Other
firstPublicationDate: "2020-05-06"
spec:
  containers:
    - image: "quay.io/eclipse/che-sidecar-node:10-0cb5d78"
      name: vscode-didact
      memoryLimit: "256Mi"
  extensions:
    - https://github.com/redhat-developer/vscode-didact/releases/download/0.1.14/vscode-didact-0.1.14.vsix
  1. Go to DIDACT TUTORIALS view and run Didact Demo
    image

  2. The page is opened in Theia Web View has no styles applied:
    image

Also, the links that calling the commands aren't working.

Expected behavior

The page is opened in Theia Web View should have the styles applied:
image

The links that calling the commands should work.

Additional context

From the browser's dev console:

main.js:469 GET https://routegp3bizjr-azatsary-che.8a09.starter-us-east-2.openshiftapps.com/webview/theia-resource/file/tmp/vscode-unpacked/redhat.vscode-didact.0.1.14.mnjqnseceg.vscode-didact-0.1.14.vsix/extension/media/webviewslim.css net::ERR_ABORTED 404
(anonymous) @ main.js:469
setTimeout (async)
(anonymous) @ main.js:466
main.js:469 GET https://routegp3bizjr-azatsary-che.8a09.starter-us-east-2.openshiftapps.com/webview/theia-resource/file/tmp/vscode-unpacked/redhat.vscode-didact.0.1.14.mnjqnseceg.vscode-didact-0.1.14.vsix/extension/media/main.js net::ERR_ABORTED 404

Sub-tasks

@azatsarynnyy azatsarynnyy added kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. area/editor/theia Issues related to the che-theia IDE of Che labels May 7, 2020
@azatsarynnyy azatsarynnyy mentioned this issue Jun 3, 2020
10 tasks
@azatsarynnyy azatsarynnyy mentioned this issue Sep 17, 2020
18 tasks
@azatsarynnyy azatsarynnyy added this to the 7.20 milestone Sep 17, 2020
@azatsarynnyy azatsarynnyy modified the milestones: 7.20, 7.22 Oct 7, 2020
@azatsarynnyy
Copy link
Member Author

I think retrieving the plugin resources for WebView can be done the similar way as we've fixed fetching the icons for the contributed Views #13750 in eclipse-che/che-theia#430

@ericwill
Copy link
Contributor

ericwill commented Oct 7, 2020

It would be great if this could make it into 7.22, as there are a number of extensions that are facing this issue.

@gattytto
Copy link

gattytto commented Oct 7, 2020

sometimes the files are downloaded/provided by the extension at runtime, but in other scenarios files are already there from the Dockerfile build process..

@gattytto
Copy link

gattytto commented Oct 23, 2020

EFanZh/vsextensions/graphviz-preview graphViz Preview needed by DAML extension (WIP)
joaompinto/vsextensions/vscode-graphviz yet another graphviz viewer
eclipse-che/che-plugin-registry#624 plantUML
are 3 more extensions blocked by this issue.
image

@azatsarynnyy
Copy link
Member Author

Thanks @gattytto for providing a use case. We plan to start investing it next month.

@gattytto
Copy link

"special" usecase is haskell which comes with DOCS from the sidecar setup:
image

@azatsarynnyy
Copy link
Member Author

@vzhukovs FYI: there's upstream Theia PR eclipse-theia/theia#8468 that seems addresses a similar issue with fetching Plug-in resources but related to CodeSnippets files.

@azatsarynnyy azatsarynnyy added the status/in-progress This issue has been taken by an engineer and is under active development. label Nov 9, 2020
@azatsarynnyy azatsarynnyy mentioned this issue Nov 18, 2020
15 tasks
@azatsarynnyy azatsarynnyy modified the milestones: 7.22, 7.23 Nov 18, 2020
@azatsarynnyy azatsarynnyy modified the milestones: 7.23, 7.24 Dec 9, 2020
@vzhukovs vzhukovs removed the status/in-progress This issue has been taken by an engineer and is under active development. label Dec 21, 2020
@azatsarynnyy
Copy link
Member Author

@nsharma1989
Copy link

nsharma1989 commented Jun 5, 2021

Hi, I am facing another issue which is related to the above problem. My plugin runs in a sidecar and uses a web view. The issue is, the web view only works once in an active session and if you close the webview and open again it doesn't load the resources. The below is the URL links to the resources from dev tools

[When view is opened for first time]
 https://CHE_THEIA_URL/webview/theia-resource/file-sidecar-EXT_ID/tmp/vscode-unpacked/EXTENSION.vsix/extension/dist/styles.cs
 
[When it never opens]
 https://CHE_THEIA_URL/webview/theia-resource/file///tmp/vscode-unpacked/EXTENSION.vsix/extension/dist/styles.css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

5 participants