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

Bug 419996

Summary: [IE only] cannot stage changes
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: GitAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: ken_walker, malgorzata.tomczyk, simon_kaegi, Szymon.Brandys
Version: 4.0Flags: simon_kaegi: review+
Target Milestone: 4.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Very bad proposition of the fix none

Description Grant Gayed CLA 2013-10-21 12:07:52 EDT
I20131018-2049
- happens in IE10 and IE11

- attempt to stage a change on the Git Status page
- it fails with the following error status displayed: "A JSONObject text must begin with '{' at character 1"
Comment 1 Simon Kaegi CLA 2013-10-21 13:05:54 EDT
Joy -- please investigate more deeply.
Comment 2 Malgorzata Janczarska CLA 2013-10-21 13:41:41 EDT
Looks like when there is an empty request data IE passes "undefined" string instead of empty string or null. On the server side we use OrionServlet.readJSONRequest(request) that reads the request data and tries to parse it into json. It is prepared for empty string and null but when it gets "undefined" it throws an exception. I suspect there might be more problems like this, not only in Git. I'm not sure what would be the best way to deal with it now.
Adding if("undefined".equals(resultString)) resultString = ""; in the right place would do the trick, but you didn't hear it from me ;)
Comment 3 Malgorzata Janczarska CLA 2013-10-21 14:02:09 EDT
Created attachment 236733 [details]
Very bad proposition of the fix

In case you would like to give it a try I'm attaching a patch.
Comment 4 Simon Kaegi CLA 2013-10-21 14:10:29 EDT
I'd prefer to look at fix client side
Comment 5 Simon Kaegi CLA 2013-10-21 15:58:21 EDT
We need to do -- xhr.send(data || null) (Thanks Grant)
This is pretty standard/safe stuff.