Skip to content

[Bug]: Broken extensions with code-server 4.8.0 #5711

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

Closed
4 tasks done
benz0li opened this issue Oct 26, 2022 · 16 comments · Fixed by #5712
Closed
4 tasks done

[Bug]: Broken extensions with code-server 4.8.0 #5711

benz0li opened this issue Oct 26, 2022 · 16 comments · Fixed by #5712
Assignees
Labels
bug Something isn't working
Milestone

Comments

@benz0li
Copy link
Contributor

benz0li commented Oct 26, 2022

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Safari 16.1
  • Local OS: macOS 13.0 (Ventura)
  • Remote OS: Debian bullseye
  • Remote Architecture: amd64
  • code-server --version: 4.8.0 005fa87 with Code 1.72.1

Steps to Reproduce

  1. Go to https://vscode-r.jupyter.b-data.ch
  2. Log in with your GitHub account
  3. Click "Start My Server"
  4. Select image R (jupyterlab/r/base:test) + code-server
  5. Open code-server
  6. Try to create an R terminal or create/edit a Jupyter Notebook

Expected

"R: Create R terminal" is supposed to create an R terminal.
ℹ️ [YYYY-MM-DD hh:mm:ss.sss] [exthost] [info] ExtensionService#_doActivateExtension REditorSupport.r, startup: false, activationEvent: 'onCommand:r.createRTerm'

When creating a Jupyter Notebook it should be displayed and editable.

Actual

No R terminal is created.

Jupyter Notebook is created but nothing is displayed.

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

@benz0li benz0li added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Oct 26, 2022
@LiveOverflow
Copy link

Probably related to CSP issues #5710 can you check this in the browser console?

@benz0li
Copy link
Contributor Author

benz0li commented Oct 26, 2022

Functionality [modified by patches] tested and found to work:

  • base-path
  • cli-window-open
  • local-storage
  • marketplace
  • service-worker

@benz0li
Copy link
Contributor Author

benz0li commented Oct 26, 2022

Functionality [modified by patches] tested and found not to work:

  • proxy-url
  • webview

proxy-url: VSCODE_PROXY_URI is now suffixed with a /.
👉 This leads to a double-/ in the browser URL of the R extension – e.g. for help().

webview: Seems to be broken entirely. R Help, R Plots, etc. not working.
ℹ️ This might be related to the added support for the Ports panel and/or "Auto Forward Ports" is related to #5710.

@benz0li
Copy link
Contributor Author

benz0li commented Oct 26, 2022

@jsjoeio Could you please stick to the approach with release candidates – especially when adding new features?

I offered you to test those to avoid situations like this.

@benz0li
Copy link
Contributor Author

benz0li commented Oct 26, 2022

Probably related to CSP issues #5710 can you check this in the browser console?

Confirmed:

csp

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 26, 2022

I reproduced on JupyterLab.

image

Let me double-check this happens locally as well.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 26, 2022

Reproduced locally too. My apologies, I tested before but must have missed a hash update somewhere.

image

A simple fix would be to add an e2e test to ensure this doesn't happen again.

@jsjoeio jsjoeio removed the triage This issue needs to be triaged by a maintainer label Oct 26, 2022
@jsjoeio jsjoeio self-assigned this Oct 26, 2022
@jsjoeio jsjoeio added this to the October 2022 milestone Oct 26, 2022
@benz0li
Copy link
Contributor Author

benz0li commented Oct 26, 2022

@jsjoeio Thank you for the prompt analysis.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 26, 2022

Identified the issue. Now working on a PR to fix this.

@code-asher
Copy link
Member

code-asher commented Oct 26, 2022

proxy-url: VSCODE_PROXY_URI is now suffixed with a /.

Ah, we added that to make sure relative paths from the proxied application work. We could remove it but my thinking is that we probably always want there to be a trailing slash (open to thoughts on this of course). For extensions the recommended method now is to use asExternalUri instead of the environment variable (we should have put this in the changelog; I will add it once we settle on what to do with the slash).

@benz0li
Copy link
Contributor Author

benz0li commented Oct 27, 2022

@jsjoeio code-server v4.8.1-rc.1 is deployed at https://vscode-r.jupyter.b-data.ch; Image R (base:test) + code-server.

@benz0li
Copy link
Contributor Author

benz0li commented Oct 27, 2022

@jsjoeio Extension functionality retested and found to work:

  1. [R] "R: Create R terminal"
  2. [Jupyter] Create/Edit/Run Jupyter Notebooks

Functionality [modified by patches] retested and found to work:

  • proxy-url
  • webview

@code-asher I will get in touch with @renkun-ken about

proxy-url: VSCODE_PROXY_URI is now suffixed with a /.

Ah, we added that to make sure relative paths from the proxied application work. We could remove it but my thinking is that we probably always want there to be a trailing slash (open to thoughts on this of course). For extensions the recommended method now is to use asExternalUri instead of the environment variable (we should have put this in the changelog; I will add it once we settle on what to do with the slash).

@benz0li
Copy link
Contributor Author

benz0li commented Oct 27, 2022

@renkun-ken Because of

  1. https://github.com/REditorSupport/vscode-R/blob/ec8b2144302dabe28abd1f38a4e5729db0b6cc49/R/session/vsc.R#L541 and
  2. https://github.com/REditorSupport/vscode-R/blob/ec8b2144302dabe28abd1f38a4e5729db0b6cc49/R/session/vsc.R#L598

the R extension depends on VSCODE_PROXY_URI and there is no way to use asExternalUri in R code. Correct?

@code-asher VSCODE_PROXY_URI will remain and not become obsolete at some point. Right?

@renkun-ken
Copy link

there is no way to use asExternalUri in R code

We don't have a direct way to use it in R code unless we pass a Uri to the R session on attach, but the documentation of asExternalUri says

Extensions should not make any assumptions about the resulting uri and should not alter it in any way. Rather, extensions can e.g. use this uri in an authentication flow, by adding the uri as callback query argument to the server to authenticate to.

I'm not sure if it is a proper way to pass in a Uri from asExternalUri called in vscode-R with a non-existent resource or something.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 27, 2022

@benz0li thank you for testing the pre-release and confirming things work! Really really appreciate it ♥️ I plan to implement some e2e tests to make sure a silly error like this doesn't happen again.

@jsjoeio jsjoeio modified the milestones: October 2022, 4.8.1 Oct 27, 2022
@code-asher
Copy link
Member

code-asher commented Oct 27, 2022

Ahhhhh that makes sense, I did not consider the use in non-JS code. To use asExternalUri it would need to call back to the extension to run asExternalUri every time it needed the URI since as noted it should not be modified but that does seem rather onerous.

VSCODE_PROXY_URI will not become obsolete however if a good way to use asExternalUri does present itself it might make sense to pursue that so the extension works in Codespaces as well!

benz0li added a commit to benz0li/quarto-cli that referenced this issue Nov 5, 2022
- It is already added since code-server v4.8.0
- coder/code-server#5711
cscheid pushed a commit to quarto-dev/quarto-cli that referenced this issue Nov 7, 2022
- It is already added since code-server v4.8.0
- coder/code-server#5711
cscheid pushed a commit to quarto-dev/quarto-cli that referenced this issue Nov 15, 2022
- It is already added since code-server v4.8.0
- coder/code-server#5711
cscheid pushed a commit to quarto-dev/quarto-cli that referenced this issue Dec 14, 2022
- It is already added since code-server v4.8.0
- coder/code-server#5711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants