Skip to content
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

Missing attributes from server are not removed #77

Open
yamsellem opened this issue May 27, 2016 · 3 comments
Open

Missing attributes from server are not removed #77

yamsellem opened this issue May 27, 2016 · 3 comments

Comments

@yamsellem
Copy link

Missing attributes from server are not removed in model:

const model = new Model();
model.save({name: 'Paul', age: 18});
// server replies {name: 'Paul'}
// model still has is age attributes equal to 18

// server replies {name: 'Paul', age: 20}
// model is correctly updated
@RickButler
Copy link

I think this is currently the expected behavior. If you do not pass { wait: true } in the options, your model will be set immediately before sync succeeds/returns.

@yamsellem
Copy link
Author

yamsellem commented May 27, 2016 via email

@RickButler
Copy link

I haven't used backbone in a while, but I don't see the behavior you are describing.

Backbone Model Save Success Callback:
https://github.com/jashkenas/backbone/blob/master/backbone.js#L639

Ampersand Model Save Success Callback:
https://github.com/AmpersandJS/ampersand-model/blob/master/ampersand-model.js#L51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants