Closed williamhaley closed 2 years ago
I have a similar issue. I used this working piece of code (I've simplified it for this report):
errors: computed('changeset.errors', function() {
let errors = this.changeset.get('errors');
if (errors.any(error => error.key == 'key'
return true;
} else {
return false;
}
}),
No changes in changeset or changeset.errors are no longer registered. Do I have to refer differently to changeset or is there a new solution? I use ember-changeset 3.8.0. I also does not work with the newest version.
I'm running into this issue; is the official advice/solution that any CPs that depend on changeset.isDirty need to be rewritten as native getters?
Ya I believe so.
I was just playing with the example above and without computeds it works. With, it doesn't. I did add dependentKeyCompat
blindly, but it seems to not have resolved it either.
https://github.com/validated-changeset/validated-changeset/issues/164
Version
ember-changeset 3.10.1
Test Case
Steps to reproduce
See test case above with my all-caps comment. If you add
@computed('changeset.isDirty')
from theisChangesetDirty
getter it stops tracking isDirty updates properly. It only works if it's a pure getter.Expected Behavior
I'd expect that there's nothing wrong with having a computed prop with dependencies calculated from
isDirty
on a changeset.Actual Behavior
See steps to reproduce above. The test fails, and in my real life app, the computed property that I use never updates because the changeset.isDirty never seems to trigger it.
I used to do something like this with Ember Octane on ember-changeset 2.x
I kept my Ember Octane at the same version but bumped up to ember-changeset 3.x. Once I did, this
@or
helper above stopped working. The data is stale and doesn't update when one of the dependent properties updates.Now I have to do this.
Not a huge deal, but a subtle breaking change for me between ember-changeset 2.x and 3.x that took a while to figure out.