adopted-ember-addons / ember-data-model-fragments

Ember Data addon to support nested JSON documents
MIT License
370 stars 114 forks source link

fix(dirty state): prevent record from being tagged as dirty when not changed #431

Closed VincentMolinie closed 2 years ago

VincentMolinie commented 2 years ago

This commit: https://github.com/adopted-ember-addons/ember-data-model-fragments/commit/f64a15ed57671923e7f630c9a5277541ea506bd4 introduced an issue on the dirty state. The attribute _data was always overridden even if the server does not send any data. This means that whenever you get a 204, the current state was _data = {} (an empty json). So whenever we try to update a property even to the same value the record is marked as dirty and the changedAttributes old value was always undefined

knownasilya commented 2 years ago

Good catch

knownasilya commented 2 years ago

Released as v5.0.0-beta.5