-
Notifications
You must be signed in to change notification settings - Fork 168
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 current UI instance upon locale change #11725
Conversation
|
||
private void registerLocaleUpdate(boolean sameUIcheckUp) { | ||
VaadinSession session = VaadinSession.getCurrent(); | ||
session.lock(); |
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.
Is it needed ?
Every Flow listener should be called under the session lock arelady.
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.
Yeah, it's not needed. VaadinSession::setLocale
checks that it already has a lock.
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.
Done
|
||
private LocaleUpdates getLocaleUpdates() { | ||
VaadinSession session = VaadinSession.getCurrent(); | ||
session.lock(); |
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.
Again: is this needed?
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.
No.
Done.
SonarQube analysis reported 3 issues
|
Hi @mshabarov and @mshabarov, when i performed cherry-pick to this commit to 2.7, i have encountered the following issue. Can you take a look and pick it manually? |
Hi @mshabarov and @mshabarov, when i performed cherry-pick to this commit to 2.6, i have encountered the following issue. Can you take a look and pick it manually? |
Fixes #11599 Co-authored-by: Mikhail Shabarov <[email protected]>
Fixes #11599 Co-authored-by: Mikhail Shabarov <[email protected]>
Description
Sets the UI on which the locale is being changed as a current UI for the thread. This is needed to have a proper
UI.getCurrent()
instance inside the executed locale change observers in components.Fixes #11599
Type of change
Checklist
Additional for
Feature
type of change