Opened 9 years ago
Closed 9 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: |
Description
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
Cc: | James Burke added |
---|
comment:2 Changed 9 years ago by
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:"http://google.com", load:function() { console.log("load called");}, error:function() {console.log("error called");}});
comment:3 Changed 9 years ago by
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
hrm... r22544 was to support appcache. How would we differentiate between a successful appcache hit and a failure working "offline"?