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

Avoid segment encoding issues #11372

Merged
merged 3 commits into from Feb 20, 2017
Merged

Avoid segment encoding issues #11372

merged 3 commits into from Feb 20, 2017

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Feb 20, 2017

I've removed all encodeURI/decodeURI stuff from the segments. Angular already encodes it in the URL automatically, so it was encoded twice in some cases.
I've currently tested the changes successfully on:

  • Internet Explorer 11
  • Chrome 56
  • Firefox 47
  • Vivaldi 1.7

Hope I haven't missed any test case...

Maybe anyone could test it on some other browsers @mattab @tsteur

side note: as the double encoded segments worked in many cases before, it might eventually be possible that this changes breaks some bookmarks having double encoded segments in it. But I haven't found any so far

fixes #11321
maybe refs #10973

@sgiehl sgiehl added the Needs Review PRs that need a code review label Feb 20, 2017
@sgiehl sgiehl added this to the 3.0.2 milestone Feb 20, 2017
@mattab
Copy link
Member

mattab commented Feb 20, 2017

Seems to work well 👍 well done. I would suggest to release this in a beta ASAP and ask wider feedback

@sgiehl
Copy link
Member Author

sgiehl commented Feb 20, 2017

Ok. Sounds good. Let's wait for the tests to pass and then we can merge and release a beta

@sgiehl
Copy link
Member Author

sgiehl commented Feb 20, 2017

Build fixed. Merging now :)

@sgiehl sgiehl merged commit 6789c01 into 3.x-dev Feb 20, 2017
@sgiehl sgiehl deleted the segmentencoding branch February 20, 2017 16:38
@tsteur
Copy link
Member

tsteur commented Feb 20, 2017

What I would recommend to test is the segment selector in exported widgets (if not done yet). Also to eg load it with a segment in the URL and hash, with a segment in the URL but different segment in hash, only a segment in hash. Each of them then afterwards also change it a few times etc. Also each case would be ideally tested with lots of multiple different conditions and with &"'#... in the values to be sure to not introduce a regression again. I remember there were some problems that time that needed some extra encoding - I think.

@sgiehl
Copy link
Member Author

sgiehl commented Feb 20, 2017

Tested the segment selector in widgetized dashboad and also in various combinations in url, hash, or directly selecting or adding one. But I'm not sure if I missed one.
Maybe it would be good to create a follow up issue to create UI tests for every test case that comes up to our mind. So we can prove everything works and will work in the future.

@tsteur
Copy link
Member

tsteur commented Feb 20, 2017

👍 on all the tests. It is not trivial...

One thing I noticed that doesn't work is when editing a segment like this and then "saving". It shows "custom segment" afterwards and I'm not sure if it's actually applied. But since @mattab changed the "save" logic to Piwik 2 logic a while ago it's likely not be a regression.

screenshot at feb 21 10-46-54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segment not valid-errors when filtering for operating system
3 participants