Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367053 - [UICallBackManager] Writes a space for check isConnectionAlive - leads to exception in UICallBack.js _handleFinished
Summary: [UICallBackManager] Writes a space for check isConnectionAlive - leads to exc...
Status: RESOLVED INVALID
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 02:51 EST by Stephan Leicht Vogt CLA
Modified: 2011-12-21 05:08 EST (History)
0 users

See Also:


Attachments
Snippet to reproduce the bug (11.87 KB, application/octet-stream)
2011-12-19 04:06 EST, Stephan Leicht Vogt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Leicht Vogt CLA 2011-12-19 02:51:32 EST
The method isConnectionAlive writes a space " " to the client. This leads to an exception in the UICallBack.js method _handleFinished. Either the writing of a space should be omited or the _handleFinished method should trim the text before the check and proccess message.
Comment 1 Ivan Furnadjiev CLA 2011-12-19 03:30:42 EST
For me it is still interesting why the response from the UICallBack request is empty - no activation, no deactivation, no send UI request. Staphan, could you provide a snippet to reproduce it?
Comment 2 Stephan Leicht Vogt CLA 2011-12-19 04:06:20 EST
Created attachment 208537 [details]
Snippet to reproduce the bug

I could reproduce it with this snippet. I reused an snippet for another bug where I just had to add this line: 
UICallBack.activate(EntryPoint.class.getName() + EntryPoint.this.hashCode());
Comment 3 Ralf Sternberg CLA 2011-12-19 06:06:13 EST
Writing characters to an output stream is the only way to check for a broken connection in Java. The native JSON parser in FF does not have an issue with leading spaces - does the json2.js parser do?
Comment 4 Ivan Furnadjiev CLA 2011-12-20 04:17:48 EST
Fixed by trimming the UICallBack response before processing. I will open another bug 367155 for the empty UICallBack response and will investigate the issue there.
Comment 5 Ivan Furnadjiev CLA 2011-12-20 11:14:30 EST
With the fix for bug 367155 trimming is not needed anymore as we *always* return valid JSON.
Comment 6 Ralf Sternberg CLA 2011-12-21 05:08:21 EST
Turned out that neither the built-in JSON parsers nor the json2.js parser has any issue with leading or trailing whitespace. Marking this bug as INVALID because the reported behavior is intended and there is nothing to fix. The problematic issue was bug 367155.