Skip to content

Commit 4201ddb

Browse files
authored
fix: use window name to detect presence of extended client details (#22760)
RouteScope logic behaves differently depending on whether extended client details have been fetched. Previously, the code checked whether the instance was null, but since #22719, UIInternal.getExtendedClientDetails never returns null. This change updates the logic to instead check ExtendedClientDetails.windowName, which is always sent by the Flow client once the details are available.
1 parent faae5c3 commit 4201ddb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vaadin-spring/src/main/java/com/vaadin/flow/spring/scopes/VaadinRouteScope.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private RouteBeanStore getBeanStore(UI ui) {
7878
ExtendedClientDetails details = ui.getInternals()
7979
.getExtendedClientDetails();
8080
String key = getUIStoreKey(ui);
81-
if (details == null) {
81+
if (details.getWindowName() == null) {
8282
ui.getPage().retrieveExtendedClientDetails(
8383
det -> relocateStore(ui, key));
8484
}
@@ -119,10 +119,10 @@ private void relocateStore(UI ui, String key) {
119119
private String getUIStoreKey(UI ui) {
120120
ExtendedClientDetails details = ui.getInternals()
121121
.getExtendedClientDetails();
122-
if (details == null) {
122+
if (details.getWindowName() == null) {
123123
return "uid-" + ui.getUIId();
124124
} else {
125-
return "win-" + getWindowName(ui);
125+
return "win-" + details.getWindowName();
126126
}
127127
}
128128

@@ -448,9 +448,6 @@ private static RouteBeanStore getBeanStoreIfExists(VaadinSession session) {
448448
private static String getWindowName(UI ui) {
449449
ExtendedClientDetails details = ui.getInternals()
450450
.getExtendedClientDetails();
451-
if (details == null) {
452-
return null;
453-
}
454451
return details.getWindowName();
455452
}
456453

0 commit comments

Comments
 (0)