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

[1.13.5] Computed properties recalculate on destroyed objects #11926

Closed
dsokolowski opened this issue Jul 30, 2015 · 6 comments
Closed

[1.13.5] Computed properties recalculate on destroyed objects #11926

dsokolowski opened this issue Jul 30, 2015 · 6 comments

Comments

@dsokolowski
Copy link

During work on my project I just encountered problem caused by computed property that was recalculated for component that has been destroyed (removed from the DOM and flag isDestroying set to true). For me it looks undesired to recalculate a bunch of computed properties on destroyed objects since it may cause exceptions or performance issues but maybe it is by design?

Here is jsbin to give you better insight into the problem: http://emberjs.jsbin.com/radopigisa/edit?html,js,output

@stefanpenner
Copy link
Member

CP are lazy and as such don't recalculate on there own. I suspect you have an eager observer or a run.schedule in your code causing the cp to be consumed

@dsokolowski
Copy link
Author

Have you seen my jsbin?

@rwjblue
Copy link
Member

rwjblue commented Jul 30, 2015

Seems to work properly on beta (unless I am misinterpretting the console output): http://rwjblue.jsbin.com/zasihe/edit?html,js,output

@stefanpenner
Copy link
Member

This is an issue with arrayComputed / reduceComputed, as they are not well behaved CP in 1.x.

It is a non-trivial fix, that is part of 2.0 and is unlikely to be backported to 1.1x

@dsokolowski
Copy link
Author

I confirm, it works properly on beta :) I should have checked it before so sorry for your time and thanks for help.

@stefanpenner
Copy link
Member

so sorry for your time and thanks for help.

No need to be sorry, we are sorry this bug exists in 1.13.x. Thanks for reporting!

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