zone.js 0.8.18 setInterval/clearInterval #934
Description
openedon Oct 21, 2017
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).
Line 45 in aec4bd4
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.