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

Broken links in Gitpod VS Code browser IDE hover widget #16494

Open
jankeromnes opened this issue Feb 21, 2023 · 2 comments
Open

Broken links in Gitpod VS Code browser IDE hover widget #16494

jankeromnes opened this issue Feb 21, 2023 · 2 comments
Assignees
Labels
editor: code (browser) meta: never-stale This issue can never become stale team: IDE type: bug Something isn't working

Comments

@jankeromnes
Copy link
Contributor

jankeromnes commented Feb 21, 2023

Bug description

When using a tool like https://github.com/autometrics-dev/autometrics-rs in Gitpod (VS Code browser), which adds localhost links with a specific query parameter to hover messages in the IDE, we can observe that clicking on these links doesn't work in VS Code browser.

Here is an IDE hover message with a few links (to localhost:9090) in it:
Screenshot 2023-02-21 at 12 20 56

However, when you click on them in Gitpod VS Code browser, the opened window shows an error that is due to a malformed query:
Screenshot 2023-02-21 at 12 53 24

If we look at the differences between the URL before Gitpod's rewrite (i.e. http://localhost:9090/...) and after Gitpod's rewrite (i.e. https://9090-<workspace_ID>.<cluster>.gitpod.io/...), we can observe several suspicious changes in the URL's query parameter:
Screenshot 2023-02-21 at 12 19 23

Steps to reproduce

  1. Open https://gitpod.io/#https://github.com/autometrics-dev/autometrics-rs
  2. Search for an occurrence of the #[autometrics macro in the code
  3. Hover over the symbol name that is just below this macro -- this will open a hover widget with some links in it
  4. Click on Request Rate (the first link)

Workspace affected

No response

Expected behavior

This should work equally well in VS Code browser and VS Code desktop.

But instead, it fails in Gitpod's VS Code browser.

Example repository

https://github.com/autometrics-dev/autometrics-rs

Anything else?

As you can see in the diff screenshot above, Gitpod's URL rewriter seems to be escaping or unescaping various characters in the link's query parameter:

  • escapes the first %20 into %2520
  • unescapes %5F into _
  • unescapes %2C into ,
  • unescapes %28 into (
  • (and a few others)

Question: Why does Gitpod seem to change anything about the query parameter? I would assume that it only needs to change the protocol + hostname + port, and leave the rest of URLs 100% unchanged. 💭

@jankeromnes jankeromnes added type: bug Something isn't working team: IDE labels Feb 21, 2023
@jeanp413 jeanp413 self-assigned this Feb 21, 2023
@jeanp413
Copy link
Member

Upstream issue microsoft/vscode#85930

@jeanp413
Copy link
Member

Partially fixed in insiders, remaining edge case is if the query part contains a %26(&)

@jeanp413 jeanp413 assigned jeanp413 and unassigned jeanp413 Mar 21, 2023
@jeanp413 jeanp413 added the meta: never-stale This issue can never become stale label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor: code (browser) meta: never-stale This issue can never become stale team: IDE type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants