Skip to content

Fix wrong isRemote false caused by the incorrect promise schedule case.#61

Open
ulion wants to merge 2 commits intocudr:masterfrom
xliulian:fix_wrong_isremote_flag
Open

Fix wrong isRemote false caused by the incorrect promise schedule case.#61
ulion wants to merge 2 commits intocudr:masterfrom
xliulian:fix_wrong_isremote_flag

Conversation

@ulion
Copy link
Copy Markdown
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