Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352738 - [Protocol] Operations may not be written to response
Summary: [Protocol] Operations may not be written to response
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-21 09:09 EDT by Tim Buschtoens CLA
Modified: 2011-07-22 10:36 EDT (History)
2 users (show)

See Also:


Attachments
example for shell (4.76 KB, application/octet-stream)
2011-07-21 09:09 EDT, Tim Buschtoens CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2011-07-21 09:09:30 EDT
Created attachment 200088 [details]
example for shell

To reproduce apply attached patch and run controls demo. The client will probably crash without the necessary changes, but we are only interested in the response message anyway.

You will notice that a "create"-operation is written, but not the "set" for text.
Comment 1 Tim Buschtoens CLA 2011-07-21 09:21:08 EDT
I think the reason for this is in the way an instance of ClientObject is re-used.

The first time an instance is requested via ClientObjectFactory#getForWidget(), the ClientObject is created and its contructor will call JavaScriptResponseWriter#getProtocolWriter(), which creates an instance of ProtocolMessageWriter and stores it in JavaScriptResponseWriter#protocolWriter.

Now some other (non-protocol) stuff is rendered, which will causes JavaScriptResponseWriter#writePendingProtocolMessage to be called.
The ProtocolMessageWriter instance will be used to write the pending operation to the JavaScriptResponseWriter, and the protocolWriter field is set back to null.


The next time ClientObjectFactory#getForWidget() is called (for the same widget), it will re-use the old ClientObject instance which
a) still contains the already written operations,
b) will not store an instance of ProtocolMessageWriter in JavaScriptResponseWriter#protocolWriter, as this is only done in its contructor.
Comment 2 Holger Staudacher CLA 2011-07-22 10:36:41 EDT
Fixed in CVS HEAD.