Best practice to show/propagate changes after successful save?

Is there a best practice for having models only show/propagate changes when the data has been successfully saved to the server?

As with Ember-data: update model and show changes only if it was successful, the idea is that the user is making changes to the model that is being used somewhere else on the page that is visible. E.g. A user profile name is displayed in the navbar, and editing it will automatically update it.

The general requirements are:

  1. Only show/propagate the changes after the data has saved.
  2. If the server responds with errors from saving, do not show/propagate the change.
  3. Making changes to a model with errors should clear out the error related to the field, but still not show/propagate the changes.

Changeset and Buffered Proxy doesn’t work here because they both apply changes to the model before saving occurs, and once the changes are applied, all the bindings to the model are updated.

1 Like

Also looking for a best practice here. I’m surprised this problem doesn’t come up that much!

For posterity, what I was trying to describe is a pessimistic behavior, as opposed to the optimistic behavior that Ember Data currently has.