#2716 closed defect (fixed)
M2: XHR support for sync mode on XHR objects is broken.
Reported by: | guest | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | IO | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In the new code split for 0.9 and the refactoring of io.bind() into separate calls, there appears to be a problem with 'sync' and XHR. With the sync flag set, the execution doesn't appear to behave sync anyway. It looks like the callbacks are not getting fired at the appropriate time. A simple testcase that depnstrates this is below:
function testXhr_sync(t){
summary: Simple test of sync'ed xhr description: Simple test of sync'ed xhr var d = new tests.Deferred();
var getArgs = {
url: "test.txt", handleAs: "text", sync: true };
var handler = dojo.xhrGet(getArgs);
console.debug("Has the handler fired? " + handler.fired); If the sync worked, this should have fired. t.assertTrue(handler.fired >= 0);
handler.addCallback(function(jsonData){
console.debug("Fired success callback."); d.callback(true);
}); handler.addErrback(function(data){
console.debug("Fired error callback."); d.callback(false);
}); return d;
}
The above always fails. The deferred shows unfired, when it should already have been fired.
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [8016]) potential fix for sync requests. Refs #2716. Needs verification