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

Render PDF: 'Open in Browser' opens wrong link (code-server with Jupyter Server Proxy) #3352

Closed
2 of 4 tasks
benz0li opened this issue Nov 16, 2022 · 7 comments · Fixed by #3410
Closed
2 of 4 tasks
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction

Comments

@benz0li
Copy link
Contributor

benz0li commented Nov 16, 2022

Bug description

render-pdf_open-in-browser

'Open in Browser' opens https://coder.jupyter.b-data.ch/hub/proxy/7095/web/viewer.html, which is wrong.


render-pdf_browse-at

Browse at shows https://coder.jupyter.b-data.ch/user/benz0li/code-server/proxy/7095/web/viewer.html, which is correct.


@jjallaire @cscheid @dragonstyle May be reproduced at https://coder.jupyter.b-data.ch with image R (jupyterlab/r/verse:latest-devtools) using

---
title: "ggplot2 demo"
author: "Norah Jones"
date: "5/22/2021"
format: 
  html:
    code-fold: true
    fig-format: svg
---

## Air Quality

@fig-airquality further explores the impact of temperature on ozone level.

```{r}
#| label: fig-airquality
#| fig-cap: Temperature and ozone level.
#| warning: false

library(ggplot2)

ggplot(airquality, aes(Temp, Ozone)) + 
  geom_point() + 
  geom_smooth(method = "loess"
)
```

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
@benz0li benz0li added the bug Something isn't working label Nov 16, 2022
@benz0li
Copy link
Contributor Author

benz0li commented Nov 16, 2022

R (jupyterlab/r/verse:latest-devtools) is based on debian:11 and has a patched version of Quarto 1.2.269 installed.

@benz0li
Copy link
Contributor Author

benz0li commented Nov 16, 2022

ℹ️ The link for 'Open in Browser' is only wrong for 'Render PDF'. For 'Render DOCX' and 'Render HTML' the link is correct.

Please consider this issue for a patch release of v1.2.

@cscheid
Copy link
Collaborator

cscheid commented Nov 16, 2022

Thanks for the report!

I don't know if we ever supported Jupyter Server Proxy in vs-code. Is this a regression?

@cscheid cscheid added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Nov 16, 2022
@benz0li
Copy link
Contributor Author

benz0li commented Nov 16, 2022

Is this a regression?

No.

@benz0li
Copy link
Contributor Author

benz0li commented Nov 16, 2022

'Open in Browser' for 'Render DOCX' and 'Render HTML' work out of the box.

I am quite sure, that the 'Open in Browser' URL for 'Render PDF' is being tampered with somewhere.

@jjallaire
Copy link
Collaborator

That popup isn't one that we are creating (that's VS Code / Code Server detecting a port). I think difference is that PDFs are hosted inside a special viewer URL whereas DOCX and HTML are hosted at the main root URL. Note that we do redirect from the main URL to the special viewer URL.

@benz0li
Copy link
Contributor Author

benz0li commented Nov 17, 2022

Note that we do redirect from the main URL to the special viewer URL.

I will check where the 'special viewer URL' is created and add a special handling for isVSCodeTerminal() && isVSCodeServer().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants