Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upnative abort does not abort jqXHR in 2.1.x #2079
Comments
This comment has been minimized.
This comment has been minimized.
|
Since 1.11.x polls it would seem to be okay, as you say. Not really sure why 3.0/master is okay though, seems like we would need an |
markelog
added
the
Ajax
label
Feb 11, 2015
timmywil
added
the
Needs review
label
May 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Should we add an onabort handler in master? |
This comment has been minimized.
This comment has been minimized.
|
Yes, it looks like we need to add one so that compat and master will have the same behavior. |
timmywil
removed
the
Needs review
label
May 6, 2015
timmywil
added this to the 3.0.0 milestone
May 6, 2015
timmywil
added
the
Blocker
label
May 6, 2015
timmywil
self-assigned this
May 18, 2015
timmywil
removed
the
Blocker
label
Jul 6, 2015
This comment has been minimized.
This comment has been minimized.
|
So, after digging into the issue, this isn't the blocker I thought it was. While we don't try to hide the native XHR, we don't encourage direct manipulation either. If you use jQuery's abort method instead, everything works fine: http://jsfiddle.net/timmywil/agg3ovxz/9/. @dmethvin Do you think this is still worth a fix? One minor speedbump is that the status text for the OP's case in compat is "error" when it should be "abort", so fixing this requires changes on both branches and I'm not sure it's something we necessarily support. |
This comment has been minimized.
This comment has been minimized.
|
@timmywil using jQuery's abort method is not an option when the browser aborts the request for some reason (computer suspend for example). |
This comment has been minimized.
This comment has been minimized.
|
So just to refresh myself without having to re-investigate, does this affect our current 3.0 master or 3.0 compat? The initial comment said it did not. |
This comment has been minimized.
This comment has been minimized.
|
@dmethvin It affects |
This comment has been minimized.
This comment has been minimized.
|
Other way around. |
This comment has been minimized.
This comment has been minimized.
|
Ah, I confused this with #2413. |
salomvary commentedFeb 10, 2015
If the native XMLHttpRequest is aborted (eg. calling abort(), suspending the computer or unloading the page) jqXHR does not fire any callbacks. Expected: fire error and complete callbacks.
Test code to reproduce:
Test code on jsfiddle.
Note: the bug is not present in 1.11.x and 3.0 (master) versions.