简体   繁体   中英

Ember store refresh issue! Error: could not respond to event didChangeData in state rootState.loaded.updated.uncommitted

I am trying to load my data using a separate query to the server after the records get dirty in the store. The updated values are sent to the server and relevant actions are performed using a custom ajax call and handled at the server side to update all the related records. But when the data is loaded again I get the above mentioned error. The possible reason could be, since the records are dirty in the store, and without committing the store I am trying to load the data again, it is giving me the error. So, I tried to do an "Application.defaultTransaction.rollback()". It removes those records from the updated bucket, but the "key" in the updated bucket (the object type) still exists and I still get the error. Can anyone help me with this?

In short: is there a way to force clean the store or move all the objects in created/updated/inflight buckets to clean bucket?

Application.store.get('defaultTransaction').rollback() will remove any dirty objects in the store and take it to the initial state. There is an open issue for store.rollback() too which might be an alternative when merged to master. https://github.com/emberjs/data/pull/350#issuecomment-9578563

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM