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

fix: keep synchronized mutation executed in order #619

Closed
wants to merge 1 commit into from

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Aug 27, 2020

Fixes #566

@ranisalt
Copy link

ranisalt commented Sep 4, 2020

This has flipped the issue for me.

Before the patch, after every request is finished and a call to mutate is issued, it would overwrite everything that was mutated before it (the parameter to the callback passed to mutate is the original value fetched, not the latest state), so the last call to mutate would contain the original state mutated by the last call to mutate only.

After this patch, the intermediate state is wrong, as every request finished suffers from the same issue of only mutating from the original state, but the final result is the correct, up to date state. See the reproduction:

https://imgur.com/qtw94UA

@huozhi
Copy link
Member Author

huozhi commented Oct 8, 2020

hi @ranisalt , sorry for my limited understanding about your problem here. would you mind giving more explanation of the incorrect behavior of this PR you mentioned? like some code samples will be super helpful, thanks

@huozhi
Copy link
Member Author

huozhi commented Oct 30, 2020

close this in favor of #735

@huozhi huozhi closed this Oct 30, 2020
@huozhi huozhi deleted the issue-566 branch October 30, 2020 15:41
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

Successfully merging this pull request may close these issues.

Race condition when mutate is called multiple times in short succession with the same key
2 participants