Skip to content

Add a new regexp to also match uri in the form /proxy/{{port}} - #14596

Merged
cderv merged 1 commit into
quarto-dev:mainfrom
micedre:fix-14595
Jun 24, 2026
Merged

Add a new regexp to also match uri in the form /proxy/{{port}}#14596
cderv merged 1 commit into
quarto-dev:mainfrom
micedre:fix-14595

Conversation

@micedre

@micedre micedre commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

closes #14595

Description

This PR add a pattern to match, used with the preview subcommand to reload the page

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR

@posit-snyk-bot

posit-snyk-bot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@micedre
micedre marked this pull request as ready for review June 16, 2026 14:18

@cderv cderv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

The new pattern looks right for code-server — /proxy/{port}/ and /absproxy/{port}/ are both valid code-server proxy URL formats, so matching both with (?:abs)? makes sense.

I want to get sign-off from the Positron team before merging, since this area has known interactions with the VS Code extension (@cscheid flagged this in the issue).

For reference from what I found:

  • Positron doesn't use VSCODE_PROXY_URI — it builds its own proxy — and its format is also /proxy/{port}/ on desktop, so the new pattern covers it correctly.
    The Workbench path (/p/{token}/) was already matched by the first regex.

No regression expected, but they should still be aware of the change.

@vezwork asking you for the Quarto VSCODE extension in case you see anything. And do you know who is best fit in positron team to ask ? I'll probably slack them.

@vezwork

vezwork commented Jun 23, 2026

Copy link
Copy Markdown
Member

I don't see anything obvious, I don't see how this could cause issues. Probably @juliasilge is the best person I know to ask.

@juliasilge

Copy link
Copy Markdown

Here is my understanding of what is going with this fix:

Posit Workbench (Positron Pro / VS Code sessions) should be unaffected

Workbench reverse-proxies sessions under a /p/<id>/ path, which is already captured by the existing first alternative (/^.*?\/p\/\w+\//). This PR adds a new alternative but does not change that one, so reload behavior in Workbench is unchanged. Like @cderv noted, Positron does not read VSCODE_PROXY_URI at all. It detects the Workbench context via the RS_SERVER_URL env var and resolves preview URLs through vscode.env.asExternalUri(), so the /p/<id>/ prefix is what reaches the browser, not a proxy path derived from VSCODE_PROXY_URI.

Positron Desktop should be unaffected

In the desktop app, asExternalUri() is effectively identity, so a previewed app stays at http://127.0.0.1:<port>/ with no /proxy/<n>/ segment in the path. None of the three regex alternatives match, so it falls through to a plain window.location.reload(), same as today.

Positron Server Web (like in JupyterHub) is newly matched, and likely a fix!

Here Positron forwards previews through its own proxy and produces external URLs of the form .../proxy/<port>/.... The existing two patterns did not match that shape, so reloads dropped the prefix, the same bug being reported here. The new /^.*?\/(?:abs)?proxy\/\d+\// alternative should now match and fix it in this environment too.

I don't know if we have the ability to test this in Positron Server on JupyterHub before merging (a pretty high lift) so I think we should go for it and look for any regressions. We do have some automated testing on the Positron side for JupyterHub.

cc @testlabauto and @isabelizimm for visibility on this upcoming change to the Quarto CLI, which I believe would fix problems with quarto preview for Positron in JupyterHub. I bet we just test quarto render right now, so mostly as a heads up!

@cderv

cderv commented Jun 24, 2026

Copy link
Copy Markdown
Member

Thank you ! I will merge this and make a new 1.10 build so you can test.

We're not close to release 1.10 so we have time to revert or adapt.

@cderv
cderv merged commit 911d85e into quarto-dev:main Jun 24, 2026
51 checks passed
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

Successfully merging this pull request may close these issues.

Reload preview with VSCODE_PROXY_URI ignores the value

5 participants