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

fix($rootScope): prevent infinite $digest loop by also checking if asyncQueue is empty when decrementing ttl #5578

Conversation

sinelaw
Copy link
Contributor

@sinelaw sinelaw commented Dec 31, 2013

An infinite $digest loop can be caused by expressions that invoke a promise. The problem is that $digest does not
decrement ttl unless it finds dirty changes; it should check also if asyncQueue is empty.
Generally the condition for decrementing ttl should be the same as the condition for terminating the $digest loop.

Closes #2622

…yncQueue is empty when decrementing ttl

An infinite $digest loop can be caused by expressions that invoke a promise. The problem is that $digest does not
decrement ttl unless it finds dirty changes; it should check also if asyncQueue is empty.
Generally the condition for decrementing ttl should be the same as the condition for terminating the $digest loop.

Closes angular#2622
@sinelaw
Copy link
Contributor Author

sinelaw commented Dec 31, 2013

The commit includes a new test that fails (actually hangs) without this fix; with the fix, the test passes.

@jeffbcross
Copy link
Contributor

Landed 2cd09c9

@jeffbcross jeffbcross closed this Jan 13, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite $digest caused by deferred/promise
2 participants