Opened 9 years ago

Closed 8 years ago

#12516 closed defect (fixed)

xhr offline: bug due to _isDocumentOk() change

Reported by: piopier Owned by:
Priority: high Milestone: 1.6.1
Component: General Version: 1.6.0
Keywords: xhr, _isDocumentOk, xhrGet, offline Cc: James Burke
Blocked By: Blocking:


I was working with Dojo 1.4 . When calling d.xhr() offline, xhr() was executing the error handler, which is a good detection of this problem. In Dojo 1.6, xhr() called offline is executing the load handler !!

It seems that this is due to a change in d._isDocumentOk() : when the ioargs.status.code is 0, _isDocumentOk() returns true...

You can see a test case in the reference guide, example 7 after checking "File-->Work offline" in firefox

Change History (4)

comment:1 Changed 9 years ago by Adam Peller

Cc: James Burke added

hrm... r22544 was to support appcache. How would we differentiate between a successful appcache hit and a failure working "offline"?

comment:2 Changed 8 years ago by jakefost

This bug also affects CORS calls in FF. If a CORS preflight fails, the status is 0 but isDocumentOk returns true. In 1.5 the following code correctly logs “error called” but in 1.6 it logs “load called”.

dojo.xhrGet({url:"", load:function() { console.log("load called");}, error:function() {console.log("error called");}});

comment:3 Changed 8 years ago by Adam Peller

(In [24489]) Rollback r22544 check for http response status 0. Refs #12516, #11230

comment:4 Changed 8 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [24490]) Rollback r22544 check for http response status 0 on 1.6 branch.

Note: See TracTickets for help on using tickets.