You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since everything is done async, from time to time, the loopback of the parent set value will actually modify the record you are trying to delete ( I guess trying to set the parent to null ), right before deletion, so the state will not be valid anymore.
If I understand correctly, it is anyway the responsability of the user to "save" the parent value on modification, so emberfire should not do what it does ( or at least not modify the record value while in deletion).
Not sure if it is understandable, but what I did was to simply override the willDeleteRecord in the application adapter by that :
recordWillDelete: functionrecordWillDelete(store,record){// here we are doing nothing. Emberfire try to update parent for belongTo relationship directly// on firebase, which would lead sometimes to an error as the child get updated, while we delete it// when the parent receive the loopback from firebase.},
and no more issue
The text was updated successfully, but these errors were encountered:
Version info
Latest version ( 2.0.8 )
Test case
This is hard to reproduce as it depends on user input, network lag, and direction of the wind.
Steps to reproduce
Delete a record while having user input or heavyload.
Expected behavior
No error on the console
Actual behavior
Error saying that record cannot be deleted because state is updated.
Explaination :
This is a funny one. Basically
recordWillDelete
( function called before actual deletion ) will update directly the parent on all belongsTo relationSince everything is done async, from time to time, the loopback of the parent set value will actually modify the record you are trying to delete ( I guess trying to set the parent to null ), right before deletion, so the state will not be valid anymore.
If I understand correctly, it is anyway the responsability of the user to "save" the parent value on modification, so emberfire should not do what it does ( or at least not modify the record value while in deletion).
Not sure if it is understandable, but what I did was to simply override the willDeleteRecord in the application adapter by that :
and no more issue
The text was updated successfully, but these errors were encountered: