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

setValue in controllers/editor.js causes race conditions #2742

Closed
bryanph opened this issue May 7, 2019 · 1 comment
Closed

setValue in controllers/editor.js causes race conditions #2742

bryanph opened this issue May 7, 2019 · 1 comment

Comments

@bryanph
Copy link
Contributor

bryanph commented May 7, 2019

Do you want to request a feature or report a bug?

Bug

What's the current behavior?

setValue is called in two places in the controller:

  1. Reacting to a prop change ( )
  2. Reacting to an internal state change (
    this.value = operation.apply(value)
    )

Because of the asynchronous nature of the two, it is possible that a rerender occurs whilst slate is applying operations locally. This has as a result that onChange wll be called with an inconsistent value.

What's the expected behavior?

value should be set either internally or through props only so that updates can correctly be queued in some way and race conditions do not occur.

@ianstormtaylor
Copy link
Owner

As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants