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

Model creation and modification race condition #151

Closed
headlessme opened this issue Nov 19, 2015 · 1 comment
Closed

Model creation and modification race condition #151

headlessme opened this issue Nov 19, 2015 · 1 comment
Labels

Comments

@headlessme
Copy link

@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
Copy link
Owner

@nilbus 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.

@headlessme headlessme closed this Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.