-
Notifications
You must be signed in to change notification settings - Fork 67
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
Validation is triggered more frequently than necessary #4390
Comments
I think this is more than a performance problem. In my case the client-side validation overrules a server-side validation. Here is a simple example:
When you enter something in field1, a validation message should appear. But the client,side validation overwrites the invalid flag immediately. In my real case, there is some business logic that sets an error message and the invalid flag when the input value is not valid. With Vaadin 24, the feature flag is still present but ignored and the client-side validation is always enabled. Therefore, all server-side validation is overridden. |
This isn't very pleasant because this prevents me from migrating to Vaadin 24! |
We are currently refactoring the validation logic of triggering the validation from the client side. The aim is to reduce the number of roundtrips and validation invocations. |
The issue will be resolved as part of #5537. |
The issue is resolved as a part of #5537. Fix is available in |
Description
Reported at #1158 (comment)
Improving validation in the scope of vaadin/platform#3066 has resulted in some performance degradation, that is, server-side validation can be triggered now more often than before. This especially hurts in cases where Binder validators make database requests.
The culprit is the
validated
event that is fired by the web component and that the server listens to nowadays. This event can be triggered in response to certain actions coming from the server, such as setting a new value. This, in turn, can lead to triggering a new round of server-side validation, even if the server has already validated that value during a prior round-trip.To illustrate the problem, consider what happens when calling
binder.setBean()
:1st round-trip:
2nd round-trip:
validated
event in the end.validated
event causes a new round-trip.Expected outcome
The server should not revalidate values that have been already validated before.
Environment
Vaadin version(s): v24
OS: Mac OS
The text was updated successfully, but these errors were encountered: