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

zone.js 0.8.18 setInterval/clearInterval #934

Closed

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions