You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ember.computed.oneWay teardown is "resetting" the property in an inner component #17243
We’ve found a real stumper of a regression in our app that git bisect says is caused by this commit (65c20ab) in 3.5.0-beta.3.
We have two components. A property is passed in to the outer component, where we use computed.oneWay to duplicate the property, then pass that into the inner component, where it is used directly (not aliased or mutated). Our setup is similar to what is shown in this Twiddle, though I wasn’t able to repro the bug on Twiddle. The property is computed once with some default values, then again on didInsertElement after we have done some measuring.
In production only, it appears that the property gets set to the default, then updated to the correct final value…then set back to the original (incorrect) value. This only happens in the inner component, even though we just pass the value in directly from the outer component and do not alias it or mutate it in the inner component.
Adding a no-op observer on the oneWay property appears to “fix” the issue, which makes sense given the PR description for that commit (#16978), though I admittedly don’t understand that code well enough to understand the mechanism.
@bekzod any thoughts about what might be going on here? I notice that you authored the commit that caused us issues. To be clear, I'm not blaming your change, it may just be exposing something strange that we're doing in our app.
I have similar issue with Ember version 3.5.1. I have aliased my model using the alias computed helper and whenever the model changes the property is not updating. If I use the model property instead of the alias, everything is working. This is happening only on production as well. It is working correctly in development and the tests are passing as well.
Activity
wagenet commentedon Dec 3, 2018
@bekzod any thoughts about what might be going on here? I notice that you authored the commit that caused us issues. To be clear, I'm not blaming your change, it may just be exposing something strange that we're doing in our app.
[BUGFIX beta] properly teardown alias
bekzod commentedon Dec 5, 2018
Will look when I get time for this :)
bekzod commentedon Jan 2, 2019
@gitKrystan pocked around, couldn't reproduce can you post repro project here ?
mupkoo commentedon Jan 3, 2019
I have similar issue with Ember version 3.5.1. I have aliased my model using the
aliascomputed helper and whenever the model changes the property is not updating. If I use the model property instead of the alias, everything is working. This is happening only on production as well. It is working correctly in development and the tests are passing as well.bekzod commentedon Jan 3, 2019
@mupkoo would be nice if you share reproduction repo or make failing test for ember :)
mupkoo commentedon Jan 3, 2019
I tried to reproduce it in a new project, but I couldn't.
Here is a snippet from my project
If I remove the
isEmptyStateVisiblecomputed property, that depends onmeetings.[], the list gets re-rendered as expected.mupkoo commentedon Jan 3, 2019
Changing
computed('meetings.[]'...tocomputed('model.[]'...is fixing the problem as wellgitKrystan commentedon Jan 7, 2019
@chancancode and I are going to look into this either today or Wednesday.
Failing test for emberjs#17243
Don't remove dep keys in `didUnwatch`
Don't remove dep keys in `didUnwatch`
Merge pull request #17487 from gitKrystan/failing-test-17243-redux
gitKrystan commentedon Jan 18, 2019
I deployed master since #17487 was merged, and this issue is fixed in our app. 👌
Don't remove dep keys in `didUnwatch`