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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSURL "'" character converted to "%27" in Chrome address bar #445

Open
dkozar opened this issue Apr 6, 2020 · 5 comments
Open

JSURL "'" character converted to "%27" in Chrome address bar #445

dkozar opened this issue Apr 6, 2020 · 5 comments
Labels
help wanted Extra attention is needed IMPORTANT Take this immediately! s:ui Scope: related to user experience, user interface, usability, accessibility t:bug Type: bug, error

Comments

@dkozar
Copy link
Contributor

dkozar commented Apr 6, 2020

馃悰 Bug Report

We noticed that, for some reason, JSURL "'" converted to "%27" in the address bar of Chrome (Windows, not sure about Mac). The Firefox displays "'".

However, copy-pasting the URL from both browsers and pasting into email produces the same result, the one with "%27":

https://covid19-scenarios-3dkfdt4h0.now.sh/?~(current~%27CHE-Basel-Stadt~containment~(~(id~%2706ad1640-ce01-41c0-8dc2-78fbbfbd8dd6~name~%27Intervention*20*231~color~%27*23bf5b17~mitigationValue~0.2~timeRange~(tMin~1583971200000~tMax~1598918400000))~(id~%27a353e47f-ed52-4517-9cb5-063878edbbca~name~%27Intervention*20*232~color~%27*23666666~mitigationValue~0.6~timeRange~(tMin~1585440000000~tMax~1598918400000)))~population~(cases~%27CHE-Basel-Stadt~country~%27Switzerland~hospitalBeds~698~ICUBeds~80~importsPerDay~0.1~populationServed~195000~suspectedCasesToday~39)~epidemiological~(infectiousPeriod~3~latencyTime~3~lengthHospitalStay~4~lengthICUStay~14~overflowSeverity~2~peakMonth~0~r0~2~seasonalForcing~0)~simulation~(simulationTimeRange~(tMin~1581724800000~tMax~1598918400000)~numberStochasticRuns~0)~ageDistribution~(0-9~884945~10-19~834866~20-29~1039727~30-39~1219227~40-49~1166590~50-59~1320623~60-69~977436~70-79~751994~80*2b~459214))

We're not sure if this is something we should care about, as long as such URL is preperly deserialized.

Note: "'" character is part of JSURL specs.

How to reproduce

Steps to reproduce the issue:

  1. Open the application in a browser
  2. Clik the RUN button
  3. Examine the link in the address bar

Chrome:

chrome

Firefox:

firefox

Related:

Note that the apostrophe is converted by the browser, unit tests prove that: https://github.com/neherlab/covid19_scenarios/blob/master/src/components/Main/state/serialization/URLSerializer.test.ts#L61

@dkozar dkozar added help wanted Extra attention is needed needs triage Review this and assign labels t:bug Type: bug, error labels Apr 6, 2020
@ivan-aksamentov
Copy link
Member

ivan-aksamentov commented Apr 7, 2020

@dkozar Oh, it's an apostrophe, not a single quote
https://www.fileformat.info/info/unicode/char/0027/index.htm

This is weird.

@nnoll @rneher
Do we have any weird symbols coming from data again, like remember this odd space character in #273 ?

If so, maybe we should have a sort of a whitelist of characters and should run a check on data generation. Extended Latin set should do for now, I think. ASCII check will probably be too narrow, but may help to find oddities as a tool for the dev process.

@ivan-aksamentov ivan-aksamentov added s:ui Scope: related to user experience, user interface, usability, accessibility IMPORTANT Take this immediately! and removed needs triage Review this and assign labels labels Apr 7, 2020
@ivan-aksamentov ivan-aksamentov modified the milestone: 1.0 Apr 7, 2020
@rneher
Copy link
Member

rneher commented Apr 7, 2020

Would this only be an issue for generated data, or could this be a problem for the names of mitigation measures as well?

@dkozar
Copy link
Contributor Author

dkozar commented Apr 8, 2020

@rneher it seems to be a cosmetic issue only (and the link is a bit longer).

The link normally deserializes to the original object, both in tests and browser:

image

We could replace JSURL with other de/serilization whenever needed. Only two lines of code must be changed for that (and tests updated):

@guandiyiyi
Copy link
Collaborator

@dkozar I found this issue is fixed in version 0.1.3 as mentioned in Sage/jsurl#6, did you try?

@dkozar
Copy link
Contributor Author

dkozar commented Apr 8, 2020

We鈥檙e using JSURL version 0.1.5:

https://github.com/neherlab/covid19_scenarios/blob/master/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed IMPORTANT Take this immediately! s:ui Scope: related to user experience, user interface, usability, accessibility t:bug Type: bug, error
Projects
None yet
Development

No branches or pull requests

4 participants