Opened 9 years ago

Closed 9 years ago

#10346 closed defect (invalid)

JsonRestStore problem with HtmlUnit resynchronize and PUTs

Reported by: ashleymoran Owned by: Kris Zyp
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:


This was found with Celerity 0.7.5 (which uses a recent HtmlUnit? 2.7 snapshot). I'm not sure if this is a HtmlUnit? bug or a Dojo bug.

Using a Dojo 1.3.2 Grid,

:resynchronize => true causes the an 'edit complete' event to fire and attempts to send a PUT request with an empty body, but an exception is thrown before it leaves Celerity :resynchronize => false apparently prevents the PUT from ever being attempted

It seems like browser resynchronising is affecting the way JsonRestStore? gets run.

My client on this project found a fix:

_overriddenXhr = dojo.xhr;
dojo.xhr = function(method,args,hasBody){
    if (method === "PUT"){
        method = "POST";
        args.headers['X-HTTP-Method-Override'] = 'PUT';
    return _overriddenXhr.apply(dojo, arguments);

this changes the PUT to a POST and adds a suitable header such that Merb routes it all appropriately.

(To run the merb app, you need to do merb -I json_server.rb)

Attachments (2)

json_server.rb (6.3 KB) - added by ashleymoran 9 years ago.
put_test.rb (2.1 KB) - added by ashleymoran 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by ashleymoran

Attachment: json_server.rb added

Changed 9 years ago by ashleymoran

Attachment: put_test.rb added

comment:1 Changed 9 years ago by ashleymoran

I've submitted this to the HtmlUnit? tracker as ticket 2898512, as I don't know whether it's a Dojo or HtmlUnit? issue. Sorry for the cross-posting.

comment:2 Changed 9 years ago by bill

Component: GeneralDojoX Data
Owner: changed from anonymous to Kris Zyp

comment:3 Changed 9 years ago by Kris Zyp

If the problem is that Celerity is unable to send PUT requests, that would be an issue with Celerity.

comment:4 Changed 9 years ago by Kris Zyp

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.