mardi 30 octobre 2018

ember, The id X has already been used with another record for modelClass

i have issues managing the deleted items in my Ember 2.18 store.

i have a "folder" model in my ember app (made with ember cli). i create a folder named "FOLDER1". I delete it, calling destroyRecord. then after successfully destroying, i do a store.unloadRecord(myFolder) in the promise. It calls my backend to delete it and updates the data store normally. The view updates accordingly, my folder seems to be deleted.

I can see the model is not present anymore in my Ember debug addon too, in Firefox, like expected.

But when i want to create an other folder named "FOLDER1", the ember data store throws this error

"The id FOLDER1 has already been used with another record for modelClass" from error.js.

like if it were not deleted. (And the ember addon kind of crashes, in the data tab, i have the list of my models, counting my folders but cannot view the content of these models when i click on it.)

Did i miss something in the deletion process, should i do something else ?




Aucun commentaire:

Enregistrer un commentaire