Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 419264

Summary: Project outliner double encodes file urls
Product: [ECD] Orion Reporter: Simon Kaegi <simon_kaegi>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon, Szymon.Brandys
Version: 4.0   
Target Milestone: 4.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Simon Kaegi CLA 2013-10-11 13:54:45 EDT
Create a project named "old mac donald". Click on project.json to view it. Then try clicking on the project folder and you will get a red fail of death.
Comment 1 Szymon Brandys CLA 2013-10-11 14:07:50 EDT
I think it is Chrome/Safari issue. I don't see it on FF.
Comment 2 Mark Macdonald CLA 2013-10-15 14:03:15 EDT
This is probably because project-nav still uses URITemplate.expand() to generate the hrefs on links. The regular nav was recently changed to avoid this -- see bug 417159 comment 7.

It is unfortunate that we are have no solution yet that lets us continue to use URI templates without messing up HREFs in certain browsers.
Comment 3 Simon Kaegi CLA 2013-10-15 22:23:42 EDT
One thing to be aware is -- https://bugzilla.mozilla.org/show_bug.cgi?id=483304 --

There is a bug in Firefox that unencodes location.hash. More info here -- http://stackoverflow.com/questions/1703552/encoding-of-window-location-hash
Comment 4 Simon Kaegi CLA 2013-10-15 23:28:00 EDT
Hmm... it looks to me like the project outliner is doing the right thing but somehow the encoding is being re-interpreted incorrectly by the input manager or ???
Comment 5 Mark Macdonald CLA 2013-10-16 00:11:28 EDT
(In reply to Simon Kaegi from comment #4)
> Hmm... it looks to me like the project outliner is doing the right thing but
> somehow the encoding is being re-interpreted incorrectly by the input
> manager or ???

If it's doing the right thing, it's not consistent.

The project's href is:
> edit.html#/file/D/old%2520macdonald/             <-- double-encoded, fails

Whereas for href of project.json (or any file inside the project) is:
> edit.html#/file/D/old%20macdonald/project.json   <-- single-encoded, works

Unless I have completely lost my mind (which is possible) -- the 2nd form is correct, and the 1st form is wrong. In Firefox, the 1st form might "work" because the browser bug you referenced unencodes window.location.hash when the inputManager obtains it post-hashchange, thereby undoing the double-encoding and saving us from a 404.
Comment 6 Simon Kaegi CLA 2013-10-24 17:35:09 EDT
Fixed in Master.