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

Handle concurrent state updates #268

Open
kettanaito opened this issue Aug 18, 2018 · 2 comments
Open

Handle concurrent state updates #268

kettanaito opened this issue Aug 18, 2018 · 2 comments
Assignees
Milestone

Comments

@kettanaito
Copy link
Owner

kettanaito commented Aug 18, 2018

What

I propose to provide a consistent reliable way of handling concurrent state updates.

Why

At the moment some concurrent updates result into obsolete fields. That causes various unexpected behaviors.

How

  1. Accumulate fieldChange during a certain period of time and handle all the accumulated payload at once. Con: That would mean an idle accumulation period, and "synced" patch state update.
  2. Get at-point fields reference on form.handleChange. In other words, maybe add a second parameter to form.updateFieldsWith(fieldProps, fields) to have explicit fields passed.

This change is not going to affect the public API and thus can be released as a minor version.

@kettanaito kettanaito added enhancement Enhances existing functionality. help wanted Extra attention is needed needs:clarification tests labels Aug 18, 2018
@kettanaito kettanaito added this to the 1.x.x milestone Aug 18, 2018
@kettanaito kettanaito added refactoring and removed enhancement Enhances existing functionality. labels Aug 31, 2018
@kettanaito kettanaito mentioned this issue Oct 16, 2018
13 tasks
@kettanaito
Copy link
Owner Author

This issue results into numerous bugs, mainly connected to keeping controlled inputs in a form. This needs to be resolved. I will try to think of a possible solutions and pick the best at the moment.

@kettanaito
Copy link
Owner Author

kettanaito commented Oct 28, 2018

I've summed it up in one of the pull requests, but I am going to repeat this here too:

The concurrency issue can be eliminated using a simple bufferTime during the event observation. That, however, bears no effect over the typing-based value updates of controlled fields. The issue lies in dispatching an event in Field.componentWillReceiveProps, which is a no-op. This may be a good reason to refine Form-Field communication pattern.

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

1 participant