Last Comment Bug 707256 - abort event listener no longer called on nsIXMLHttpRequest
: abort event listener no longer called on nsIXMLHttpRequest
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Mac OS X
: P2 normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: 697775 705011
  Show dependency treegraph
 
Reported: 2011-12-02 11:36 PST by Irakli Gozalishvili [:irakli] [:gozala] [@gozala]
Modified: 2013-01-23 02:07 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Irakli Gozalishvili [:irakli] [:gozala] [@gozala] 2011-12-02 11:36:05 PST
In jetpack we observe regression on nightlies with nsIXMLHttpRequest, abort event listeners are no longer called when requests are aborted. Here is a simple test case:

var aborted = false;
var xhr = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1'].
          createInstance(Ci.nsIXMLHttpRequest);
xhr.addEventListener('abort', function() { aborted = true }, false);
aborted // is false (on nightly) while expected to be true
Comment 1 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-12-02 11:42:17 PST
Regression range?
Comment 2 Irakli Gozalishvili [:irakli] [:gozala] [@gozala] 2011-12-02 13:48:32 PST
I don't know when regression has been introduced, but it seems to work as expected on aurora.
Comment 3 [github robot] 2011-12-02 13:49:33 PST
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/8a927261d7fd06bf0c5a1ae62f2b236ca8305bad
Disable failing XHR test until platform bug 707256 is fixed.
Comment 4 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-12-02 13:52:00 PST
> I don't know when regression has been introduced,

Are you willing to figure that out using http://harthur.github.com/mozregression/ ?
Comment 5 Alex Vincent [:WeirdAl] 2011-12-02 14:06:15 PST
We had a recent change to abort event dispatch in bug 703380.  That bug was about abort events firing after a load or error event fired, which is incorrect behavior.  Could this be related to that?
Comment 6 Alex Vincent [:WeirdAl] 2011-12-02 14:40:54 PST
Yeah, I think it's definitely related.  The XHR2 spec states that if the request is in an UNSENT state, then the event should not be fired:

http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-abort-method

The testcase in comment 3 does not reflect that:  it checks the event count before and after the abort call, but send is never called.
Comment 7 Alex Vincent [:WeirdAl] 2011-12-02 14:55:44 PST
Here's your regression:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3b066c050d3
Comment 8 Masatoshi Kimura [:emk] 2011-12-03 00:37:05 PST
Yeah, it's intentional and expected that "abort" event will not be fired in UNSENT state. The test should be fixed.
Comment 9 [github robot] 2011-12-06 19:12:00 PST
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/604069d1d7277025b062372682da5e02a8be04fd
Disable failing XHR test until platform bug 707256 is fixed.(cherry picked from commit 8a927261d7fd06bf0c5a1ae62f2b236ca8305bad)
Comment 10 [github robot] 2012-01-10 13:37:39 PST
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/604069d1d7277025b062372682da5e02a8be04fd
Disable failing XHR test until platform bug 707256 is fixed.(cherry picked from commit 8a927261d7fd06bf0c5a1ae62f2b236ca8305bad)

Note You need to log in before you can comment on or make changes to this bug.