ember-data-change-tracker
ember-data-change-tracker copied to clipboard
Ember 3.14
Hello,
I am getting this error on 3.14 (with ember-data 3.13 and 3.14):
Error: Assertion Failed: You attempted to update [object Object].hasAnyRelationshipData to "true", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.
at assert (index.js:172)
at ManyRelationship.set [as hasAnyRelationshipData] (index.js:790)
at ManyRelationship.setHasAnyRelationshipData (-private.js:10663)
at ManyRelationship.updateRecordDatasFromAdapter (-private.js:10652)
at ManyRelationship.updateData (-private.js:10999)
at ManyRelationship.push (-private.js:10704)
at RecordDataDefault._setupRelationships (-private.js:11532)
at RecordDataDefault.didCommit (-private.js:11629)
at InternalModel.adapterDidCommit (-private.js:5961)
at Store.didSaveRecord (-private.js:14140)
Not tracking the changes on the model fixes it, so it is related to the tracking itself. This happens after a successful save as you can see, when the data is reloaded.
@juggy .. if you have the energy to examine the source of the issue and fix it then please do. I will accept a PR with the fix.
I'm not even sure this is specific to ember-data-tracker. I encounter the same error when using this kind of property in an ember app
get notification() {
return user.hasMany('fileTransferNotifications').value().firstObject;
}
end reloading the user.