-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug] Ember octane computed properties regression #19279
Comments
simplier regression case: https://ember-twiddle.com/d83a6cf6d6d7ce0a71d9686f4ff202ad?openFiles=templates.application%5C.hbs%2C |
Your CP When I rewrite your CP to use Can you update your reproduction such that CPs use exactly the properties they depend on and don't access two arrays deep in one CP? |
@lolmaus |
AFAIK:
But I was able to reproduce this bug while adhering to these two points! Repro (set to // still need `countAdditives` to trigger recomputation
allAdditiveArrays: computed('metaAttributes.@each.{countAdditives,additives}', function () {
return this.metaAttributes.map((meta) => meta.additives);
}),
allAdditives: computed('allAdditiveArrays.[]', function(){
return [].concat.apply([], this.allAdditiveArrays); // flatten array of arrays
}), |
Oh, I just forgot how to do it properly. The flattening CP should depend on This works in allAdditiveArrays: computed('[email protected]', function () {
return this.metaAttributes.map((meta) => meta.additives);
}),
allAdditives: computed('allAdditiveArrays.@each.[]', function(){
return [].concat.apply([], this.allAdditiveArrays);
}), |
closing it, because fix is merged to 3.24 |
Minimal reproduction: https://ember-twiddle.com/ed259f439203096ac88c0e0aaa3383f1?openFiles=twiddle%5C.json%2C
Working in 3.12
Not working in 3.13 (from beta) till 3.23
Tl dr:
nested computed properties, related to arrays not triggered
This issue does not related to ember-data, tested on (3.12 - 3.23), and only ember-source cause regression
One more behavour (likely not related to this bug, but may be related to computed properties)
during an large MDD app migration to Octane, I've faced to issue, related to relation tracking, using computed properties - https://ember-twiddle.com/ed17ef8abcdfca94599b2e5aa385485d?openFiles=templates.application%5C.hbs%2C
(middlename value appear in input, but not appear in template after new model was added)
Without e-data it seems working as expected https://ember-twiddle.com/222a3f1e1bb9f244b35a725fc03621f7?openFiles=templates.application%5C.hbs%2C
The text was updated successfully, but these errors were encountered: