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

Bug 352738

Summary: [Protocol] Operations may not be written to response
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: holger.staudacher, tbuschto
Version: 1.5   
Target Milestone: 1.5 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
example for shell none

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.