fix #8903 Encode workspacePath before being used as URL hash value. #8909
fix #8903 Encode workspacePath before being used as URL hash value. #8909shuyaqian wants to merge 2 commits intoeclipse-theia:masterfrom shuyaqian:master
Conversation
vince-fugnitto
left a comment
There was a problem hiding this comment.
Thank you for your contribution @shuyaqian 👍
Before it can be accepted, please be sure to:
- include a proper sign-off for your commit.
- be sure to sing the Eclipse Contributor Agreement (ECA) with the same email as your
sign-off
This is the reason for the failing ECA check.
Signed-off-by: shuyaqian <717749594@qq.com>
I've added it. Thank you. |
There was a problem hiding this comment.
@shuyaqian the changes work for me when starting the example browser application, but not the electron (desktop) application.
To test you can do the following:
- start the example-electron app:
yarn start:electron - attempt to open a folder with
%2in the name
|
What about this location? |
I guess here is the missing part: This is quite a breaking, isn't it? I might be overlooking something, but if this is a breaking change, please include it in the changelog. Thanks! |
Thank you for your suggestion. I've revised it. |
vince-fugnitto
left a comment
There was a problem hiding this comment.
@shuyaqian sorry for taking a while to get back to the pull-request, would you mind rebasing the pull-request to the latest master, and also including an breaking change note in the changelog regarding the changes (it might be better to be transparent that urls are now encoded when opening the application from now on).
Please also check if we need to change it here. Thanks! |
Signed-off-by: shuyaqian <717749594@qq.com>
I've revised it, thank you very much! |
vince-fugnitto
left a comment
There was a problem hiding this comment.
@shuyaqian thank you for the changes! 👍
I confirmed that opening a workspace named a%20b can now be successfully opened in both the browser and electron targets.
| await this.openDefaultWindow(); | ||
| } else { | ||
| await this.openWindowWithWorkspace(workspacePath); | ||
| await this.openWindowWithWorkspace(encodeURI(workspacePath)); |
There was a problem hiding this comment.
Encoding should be done when setting withFragment, not here.
|
@shuyaqian are this changes not useful anymore? Note that I had an unresolved comment. |

What it does
fixes #8903
Encode workspacePath before being used as URL hash value when openNewWindow.
How to test
Review checklist
Reminder for reviewers