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 creation and modification race condition #151

Open
headlessme opened this Issue Nov 19, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@headlessme

headlessme commented Nov 19, 2015

If a model is modified several times in quick succession, before a response from the server is received this leads to duplicate models created in the local storage. This seems to be because the Backbone generated cid is ignored and instead a copy of the model is created in modelUpdatedWithResponse along with it's own GUID that's used in local storage.

What is the purpose of creating a copy of the model when an existing one is available and could be updated instead?

@nilbus

This comment has been minimized.

Show comment
Hide comment
@nilbus

nilbus Nov 24, 2015

Owner

Although we no longer use clone() because of #75, the commit message on e4f1ba8 explains the rationale behind not passing the original model to localsync.

Given this incorrect behavior you're seeing, maybe there is a better approach. I would consider any alternatives you come up with.

Owner

nilbus commented Nov 24, 2015

Although we no longer use clone() because of #75, the commit message on e4f1ba8 explains the rationale behind not passing the original model to localsync.

Given this incorrect behavior you're seeing, maybe there is a better approach. I would consider any alternatives you come up with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment