-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model.changedAttributes not cleaned out after save #8329
Comments
a failing test would be great |
It took me a few tries to figure out how to run the test suite, but I think I've got a failing test to work off now: #8335 |
Was this issue fixed? I can still reproduce it under v4.11 - modifying then saving a record has |
@kiosion it was. If we didn't backport it then its in 4.12 only. |
Hi @runspired, would it be possible to backport the fix for 4.8? It would be much appreciated, thanks! |
Reproduction
I have a repro case in a simple ember application: https://github.com/timmorey/ember-data-changed-attrs. You can see the failure by cloning and then running
npm install && npm run test
.The application defines a single model and configures the application REST adapter/serializer. ember-cli-mirage provides a mock backend to support the model. The test case is coded as an acceptance test that will fail when it hits the issue, and succeed if
changedAttribute
behaves as expected.See test case in https://github.com/timmorey/ember-data-changed-attrs/blob/main/tests/acceptance/model-changed-attributes-test.js. A basic summary:
I'm also going to try to take a stab at coding a failing test in ember-data itself, but I've never done that before...
Description
The
Model.changedAttributes()
method continues to indicate that attributes have been changed after the changes to the model have been saved. In previous versions of ember-data (< 4.7.0), this method would indicate that there are no changed attributes after asave()
.This is confounding some logic we have in another application, where we look at
changedAttributes()
in the adapter to determine how to save the changes.Versions
I cannot reproduce in 4.6.3, but can in 4.7.0. Also validated that the issue is reproducible in 4.8.3 and 4.9.0-beta.3.
The text was updated successfully, but these errors were encountered: