Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit disabled dispatching fix to inserted and removed events #220

Merged
merged 3 commits into from
Mar 28, 2017

Conversation

ccummings
Copy link
Contributor

The fix for #207 causes an infinite loop. Every time a disabled element has an event dispatched, there are 2 mutation events that are emitted (one for enabling and one for disabling the element).
When those 2 events go through dispatch 4 more mutation events are emitted (2 for each event) are emitted and so on exponentially.

This fix limits the new logic in dispatch to the two most common synthetic events a CanJS user will encounter (inserted and removed). This does mean that other synthetic events will have an issue but this bug in FF has been around for 11 years and to my knowledge has not been caused a big problem thus far.

Copy link
Contributor

@phillipskevin phillipskevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good once tests pass.

@ccummings ccummings force-pushed the fix-infinite-disable-mutations branch from 71c7043 to b061ba2 Compare March 28, 2017 16:07
@phillipskevin phillipskevin merged commit 450983f into master Mar 28, 2017
@phillipskevin phillipskevin deleted the fix-infinite-disable-mutations branch March 28, 2017 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants