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

Possible stale store is passed into update call for mutate #50

Closed
wants to merge 1 commit into from

Conversation

jnutter
Copy link
Contributor

@jnutter jnutter commented Mar 23, 2017

If two mutation requests (2 create with sync ids that get updated to object ids on success in our case), only the last mutation saves.

@ryanashcraft
Copy link
Contributor

See my comment: #37 (comment)

Maybe we should reconsider favoring the most recent version instead of reverting to the original. Although I'm hesitant to do this because it's not an insignificant behavioral change. Thoughts @ManThursday?

@trashstack
Copy link
Contributor

If I'm understanding correctly:

  • The existing code silently drops intermediate updates if the request fails.
  • This change prevents the optimistic update being rolled back on a failure.

Neither case seems great but I think the latter is marginally better because it's easier to add code to manually rollback the optimistic update than it is to recover lost changes from other requests.

Perhaps we should merge this and then add an optional (or even required) "rollback" property to the query config so that there is an explicit way to handle the failure of an optimistic update. What do you think?

@ryanashcraft
Copy link
Contributor

@jnutter Thanks for the PR and raising this issue. After consideration we decided we should definitely fix this issue, but we're going to do it within a larger set of changes that should also address #9. I plan to work on these changes soon, I'll be sure to mention you once I have a PR.

@ryanashcraft ryanashcraft mentioned this pull request Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants