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

multiple propertyDidChange triggering observers only once #9497

Closed
patricklx opened this issue Nov 5, 2014 · 2 comments
Closed

multiple propertyDidChange triggering observers only once #9497

patricklx opened this issue Nov 5, 2014 · 2 comments

Comments

@patricklx
Copy link
Contributor

See this jsbin:
http://jsbin.com/mipibunusu/1/edit?html,js,console,output
This jsbin mimics the behaviour of reduce computed and ember data.
In the console output you can see the counter increasing, but then only decreases once.

I encountered this issue while working on #9492 .

reduce computed counts the number of willChange and didChange. see this line

However, sometimes it did not receive the didChange event, which then causes it not to flush the changes. Especially when ember data is used.

@rwjblue
Copy link
Member

rwjblue commented Nov 6, 2014

I did a little digging on this one. Brain dump follows:

Inside ComputedPropertyPrototype.didChange we call removeDependentKeys which calls unwatch here. After that, the data key is marked as not being watched causing the guard in propertyDidChange here to do an early return.

This seems like expected (but bizarre) behavior, but I'll let others that are more familiar with the metal caching strategies chime in to confirm.

@rwjblue
Copy link
Member

rwjblue commented Aug 9, 2015

reduce computed has been removed (as have before observers) so I believe this issue is likely resolved.

@rwjblue rwjblue closed this as completed Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants