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

zone.js 0.8.18 setInterval/clearInterval #934

Closed
bredmold opened this issue Oct 21, 2017 · 2 comments · Fixed by #935
Closed

zone.js 0.8.18 setInterval/clearInterval #934

bredmold opened this issue Oct 21, 2017 · 2 comments · Fixed by #935

Comments

@bredmold
Copy link

I've been working on a Angular app and I tracked a bug I've been seeing back to zone.js ... if my application runs setInterval/clearInterval, the main Angular zone never reports itself to be stable afterward. This is causing problems when I run Protractor tests.

I've built a small Angular 4 application that demonstrates the problem.

https://github.com/bredmold/zone-bug

What seems to be happening when I step through the JS in the browser is that the timer handle is being thrown out after the browser's native setInterval method returns (presuming I'm interpreting the code correctly).

delete tasksByHandleId[data.handleId];

When clearInterval is called, zone.js has no way to address the timer handle and locate the task being cancelled. Thus, the task counts are never updated, hence the zone cannot report itself to be stable... and my tests time out.

The obvious workaround would be to not call setInterval/clearInterval in my application, but they're in a third-party library. I hope there's enough information here to act on.

@JiaLiPassion
Copy link
Collaborator

@bredmold , thanks for posting the issue, I will check it.

@adrienverge
Copy link

For your information, I have the same problem and pull request #935 solves it. Let's hope it can be merged soon!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants