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

[Form lib] Add option to indicate that a validator is asynchronous #109628

Closed
sebelga opened this issue Aug 23, 2021 · 2 comments
Closed

[Form lib] Add option to indicate that a validator is asynchronous #109628

sebelga opened this issue Aug 23, 2021 · 2 comments
Labels
enhancement New value added to drive a business result Feature:FormLib Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@sebelga
Copy link
Contributor

sebelga commented Aug 23, 2021

Consumers of the form lib can add synchronous and asynchronous validators to their field and it works "out of the box". This has a not optimal side effect: asynchronous HTTP request are called twice.

Indeed, the form lib will first try to run all the validators synchronously. If it detects that one validators returns a then, it knows that it is asynchronous. It then re-run all the validations asynchronously. Which trigger a second HTTP request.

We need to add an option to the validations (e.g. isAsync: true) which allows the consumer to tell beforehand that there is an asynchronous validation so the form lib can immediately await for the validations to run.

@sebelga sebelga added enhancement New value added to drive a business result Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Aug 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-management (Team:Stack Management)

@sebelga
Copy link
Contributor Author

sebelga commented Jun 28, 2022

@sebelga sebelga closed this as completed Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:FormLib Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

2 participants