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

Commas in variable values break URL sync and interpolation #683

Open
rdubrock opened this issue Apr 8, 2024 · 0 comments
Open

Commas in variable values break URL sync and interpolation #683

rdubrock opened this issue Apr 8, 2024 · 0 comments
Labels
area/variables Issues related to variables system in scenes type/bug Something isn't working

Comments

@rdubrock
Copy link

rdubrock commented Apr 8, 2024

A variable value that has a comma in it will end up getting cut off. I think this happens as a result of how values are getting serialized in the URL. To reproduce use a URL with a comma as the variable value:

const value = "https://www.example.com/?ll=39.383,-29.238&radius=2000"
const myVar = new CustomVariable({
      name: 'myVar',
      query: value,
      value,
    });
    
console.log(myVar.getValue()) // Will log out the correct value

However, the resulting variable will show up malformed in the URL:

...&var-myVar=https:%2F%2Fwww.example.com%3Fll%3D39.383&from=now-1h&to=now

Other URL unsafe characters are escaped, but a comma just results in the value getting cut off. This malformed version of the value is what ends up getting interpolated into queries, which fail as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/variables Issues related to variables system in scenes type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant