Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Aborted requests on IE9 are not completed #10214

Open
montgomery1944 opened this issue Nov 25, 2014 · 6 comments
Open

Aborted requests on IE9 are not completed #10214

montgomery1944 opened this issue Nov 25, 2014 · 6 comments

Comments

@montgomery1944
Copy link

In one of the applications we had to write a mechanism of aborting previous requests, when the new will be fired, you can see the simplified version here: http://plnkr.co/edit/ntDsVwDgG8digzjxBfKX.

The problem is, that after the change introduced in #9329 abortion of requests on IE9 stopped working, because "onabort" event is not supported there, which means that "completeRequest" function won't be called at all on abort.

In provided plunker you will see alert with message "ABORT" on all supported browsers except IE9.

Please have on mind, that IE9 is behaving weirdly when aborting the request, which was already fixed in Angular in #4940.

@realityking
Copy link
Contributor

Rats. I don't have time to look at it right now as we're having a big release next week, after that I'll try to take a look at it if nobody beats me to it.

A cursory Google search shows that there seem to be quite a few issues with aborting request in IE9 where the request isn't really aborted. However I don't see how #4940 relates to it as we're not accessing the xhr object in the onabort handler.

@pkozlowski-opensource
Copy link
Member

@realityking I agree that it doesn't seem to be related to #4940.

Then, when it comes to aborting request on IE - it would be awesome if you could have a look at this one! I'm moving it to 1.3.6 so this issue doesn't get forgotten.

@pkozlowski-opensource pkozlowski-opensource modified the milestones: 1.3.6, 1.3.5 Nov 26, 2014
@caitp caitp modified the milestones: 1.3.6, 1.3.7 Dec 9, 2014
@petebacondarwin
Copy link
Contributor

@realityking - did you get time to take a look at this problem?

@petebacondarwin petebacondarwin modified the milestones: 1.3.7, 1.3.8 Dec 15, 2014
@realityking
Copy link
Contributor

Sorry, took me a while to get to this. First the plunkr can not be used directly as IE9 does not support CORS. I created a slightly different one to test: http://plnkr.co/edit/M1NbCR752zhHqYaWfl2D

The problem is however relatively simple, IE9 just doesn't implement onabort at all. The following events are implemented:

  • onload
  • ontimeout
  • onreadystatechange

Note that onerror is also missing.

This leaves us in a pretty bad spot. If we don't want to revert to onreadystatechange (with all the issues that it had) the only thing we could do is manually call completeRequest when the browser is IE9. I'll create a pull request for that.

@btford btford modified the milestones: 1.3.8, 1.3.9 Dec 19, 2014
@pkozlowski-opensource pkozlowski-opensource removed this from the 1.4.0-beta.1 / 1.3.10 milestone Jan 20, 2015
laurelnaiad added a commit to laurelnaiad/marklogic-samplestack that referenced this issue Jan 22, 2015
Should help with cases where IE has bombed due to
angular/angular.js#10214, by failing out o
the test.
laurelnaiad added a commit to laurelnaiad/marklogic-samplestack that referenced this issue Jan 22, 2015
Should help with cases where IE has bombed due to
angular/angular.js#10214, by failing out of
the test before SauceLabs ditches it in a way that causes protractor
to lose track of it.

At best, we may have an IE test failure that no longer hangs the entire
e2e suite until such time as Travis times the whole thing out. :)
laurelnaiad added a commit to laurelnaiad/marklogic-samplestack that referenced this issue Jan 22, 2015
Should help with cases where IE has bombed due to
angular/angular.js#10214, by failing out of
the test before SauceLabs ditches it in a way that causes protractor
to lose track of it.

At best, we may have an IE test failure that no longer hangs the entire
e2e suite until such time as Travis times the whole thing out. :)
@laurelnaiad
Copy link

@realityking, is there a PR for this that I could turn into a monkey-patch for my project? As you can see I've sort of worked around the problems this is causing in e2e tests by crashing the tests more quickly so they don't stall, but the app itself is hanging at a spinner due to never getting a timeout from the request when travis is slow. I'm sure I could cook up something ugly in an interceptor, but if you have something lying around, it might be helpful. :)

@lorenzodallavecchia
Copy link

lorenzodallavecchia commented Jun 23, 2016

In addition to IE9, some Mobile Safari versions seem to be affected.

This problem also happens when the request times out by itself (with the default browser timeout), because in that case ontimeout is called, and Angular is not listening to that one.
Fortunately, that issue can be mitigated by specifying a timeout when calling $http (Angular will complete the request when the time runs out).

@Narretz Narretz modified the milestones: Backlog, 1.5.x Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants