-
Notifications
You must be signed in to change notification settings - Fork 176
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
fix: Update UI if custom errorHandler #17504
Conversation
Enable update of UI for beforeClientResponse execution when a custom ErrorHandler is set. Fixes #17352
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that I understand why vaadinSession.getErrorHandler().error(new ErrorEvent(t));
isn't called or doesn't apply UI error-related custom changes when before client reponse callback throws.
When the exception occurs in the callback, it arises from writeUidl
to the handleExceptionDuringRequest
.
How it makes difference where the exception is thrown, because UIDL write is interrupted anyway if it happens a bit before or later than before client response callbacks handling?
I assume that besides runExecutionsBeforeClientResponse
method we have few other places where exceptions potentially can happen that also would break the UIDL writing.
Will do more code digging.
So the normal UIDL request is handled in ServerRpcHandler before write and normal exceptions happen during the invocation handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @caalador for explanations, now I think I got it. Looks good to me. Seems like there is nothing else called in writeUidl
that might have a user code. JS invocations maybe, but they are not executed on the server anyway.
Enable update of UI for beforeClientResponse execution when a custom ErrorHandler is set. Fixes #17352 Co-authored-by: Peter Czuczor <61667986+czp13@users.noreply.github.com>
Enable update of UI for beforeClientResponse execution when a custom ErrorHandler is set. Fixes #17352 Co-authored-by: Peter Czuczor <61667986+czp13@users.noreply.github.com>
Enable update of UI for beforeClientResponse execution when a custom ErrorHandler is set. Fixes #17352 Co-authored-by: Peter Czuczor <61667986+czp13@users.noreply.github.com>
I wonder if this caused some breaking change? After this was merged, certain |
Nothing should change if there is no custom ErrorHandler set. |
It's actually those tests that have
|
Ok. That's an interesting state, I'll add a null handler test and look into it. |
Seems the underlying issue is the mock session that returns a null ErrorHandler at which it fails. Fix incoming. |
This ticket/PR has been released with Vaadin 24.2.0.alpha10 and is also targeting the upcoming stable 24.2.0 version. |
Enable update of UI for beforeClientResponse
execution throwing an exception when a
custom ErrorHandler is set.
Fixes #17352