Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'abort' event not fired in #9546

chrisch-hh opened this issue Jul 17, 2018 · 0 comments


None yet
1 participant
Copy link

commented Jul 17, 2018

Don't know if it is a bug or my fault, but it seems that the abort event in isn't fired correctly.

I have a tree and when the user selects a node, a request is send to fetch some additional data from a server. If the user selects another node and the request hasn't finished yet, it is canceled/aborted. I want to detect the abort of the request, but the abort event isn't fired as expected.

If I set my own function to the native XMLHttpRequest's onabort function, it is called on the abort of the request and I use this as a workaround at the moment. The problem might be that doesn't capture/handle the abort of the request correctly.

I looked into the source code of and tried to understand how the abort event is triggered. In the __initNativeXhr method there is:

// Track native abort, when supported
if (this.__nativeXhr.onabort) {
 this.__nativeXhr.onabort = this.__onNativeAbortBound;

this.__nativeXhr.onabort seems to be always null during the construction phase, so the __onNativeAbort function is never bound to the XMLHttpRequest's onabort function.

In the __readyStateChangeDone function, the abort event is emitted. This function is called when the request's readyState reaches But in the case of an abort, the readyState never reaches DONE (in my use case), it remains on OPENED. So the __readyStateChangeDone function never gets called and the abort is not emitted.

Would be great if someone with more expertise could have a look on that.

Desktop (please complete the following information):

  • OS: [Windows 10, Apache 2.4]
  • Browser [Chrome 67, Firefox 61]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.