Open sly7-7 opened 2 years ago
@sly7-7 FYI there is related PR #645 which fixes working with Ember Data (there are at least several ways of doing so, that PR suggest one way of doing it).
@SergeAstapov Hi, thank you for taking time to answer. Unless I'm missing something, my use case is different, as I don't use snapshot/restore, but execute/unexecute. That said, I've tried to run against the PR branch you mentioned, and I have the same "buggy" behavior. When execute
ing changes to the model, this works fine during deep merge, but when unexecute
ing, it tries to deepmerge two ember-data models (even cloning the underlying backburner instance).
So I think there is something wrong when the changeset is "saving" the oldContent during execute
, which makes unexecute
behaves badly.
Version
ember-changeset@4.1.0
Test Case
I've created a test here: #653
Steps to reproduce
Expected Behavior
I was expecting the changeset to have the previous belongsTo model associated.
Actual Behavior
It seems like ember-changeset should work well with Ember-Data, but I think I do somehting wrong, because it crashes during
unexecute
, when it encounters a belongsTo relation.but I don't do any merge by myself