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

Ember 3.14 #82

Open
juggy opened this issue Nov 28, 2019 · 2 comments
Open

Ember 3.14 #82

juggy opened this issue Nov 28, 2019 · 2 comments

Comments

@juggy
Copy link

juggy commented Nov 28, 2019

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.

@danielspaniel
Copy link
Owner

@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.

@sly7-7
Copy link

sly7-7 commented Mar 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants