The default bug view has changed. See this FAQ.

abort event listener no longer called on nsIXMLHttpRequest

RESOLVED FIXED

Status

Add-on SDK
General
P2
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: irakli, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

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
Blocks: 705011, 697775
Regression range?
Component: Networking: HTTP → DOM
QA Contact: networking.http → general
I don't know when regression has been introduced, but it seems to work as expected on aurora.

Comment 3

5 years ago
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.
> I don't know when regression has been introduced,

Are you willing to figure that out using http://harthur.github.com/mozregression/ ?
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?
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.
Here's your regression:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3b066c050d3
Yeah, it's intentional and expected that "abort" event will not be fired in UNSENT state. The test should be fixed.
Component: DOM → General
Product: Core → Add-on SDK
QA Contact: general → general
Version: Trunk → unspecified

Comment 9

5 years ago
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)

Updated

5 years ago
Priority: -- → P2

Comment 10

5 years ago
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)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.