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

XMLHTTPRequest abort multipletimes will cause updateTaskCount incorrect #569

Closed
JiaLiPassion opened this issue Dec 29, 2016 · 0 comments
Closed

Comments

@JiaLiPassion
Copy link
Collaborator

Based on #287, and the comment from @RicardoVaranda's comment, the XMLHTTPRequest will cause Uncaught Error: More tasks executed then were scheduled. The error can be described
as

const req = new XMLHttpRequest();
      req.open('get', '/', true);
      req.send();
      req.addEventListener('readystatechange', function(ev) {
        if (req.readyState >= 2) {
          req.abort();
        }
      });

The abort will be called multiple times before the request is done.
So we should add logic to verify whether the request has already been aborted.

JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Dec 29, 2016
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Dec 30, 2016
… abort multipletimes

the fix is check whether the xhr has been aborted before abort the request
JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Dec 30, 2016
… abort multipletimes

the fix is check whether the xhr has been aborted before abort the request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant