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 wrong isRemote false caused by the incorrect promise schedule case. #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ulion
Copy link
Contributor

@ulion ulion commented Feb 7, 2021

The isRemote false promise should only be scheduled when any apply (slate schedule onChange in first apply) really happened.
Else, currently, is we got two remote applyOperation calls one by one, the first empty slate op one will schedule isRemote false, then the 2nd applyOperation will schedule onChange, and another isRemote false. which finally will cause the onChange runs with e.isRemote === false, and which will cause the remote caused slate ops be applied as local slate op again, and it will cause error.
This PR make sure only schedule isRemote = false when there is any onChange is scheduled, then it runs just after it to clear the isRemote flag.

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.

1 participant