We have a Spring Boot 3.2.8 application using Vaadin. We have a custom afterNavigationListener
registered in the ServiceInitListener
class to rewrite the url to add a custom parameter, using ui.getPage().getHistory().replaceState(null, uriString);
After the Vaadin upgrade to version 24.4.7 the pages are initialized two more times, the first with the navigation trigger type PAGE_LOAD, the others with HISTORY. This implies three calls to beforeEnter, afterNavigation, getPageTitle
and probably all methods related to the page lifecycle.
We tried different Vaadin versions, always doing a mvn clean and a mvn vaadin:dance between tests, and also deleting manually remaining generated files if necessary.
After a downgrade to version 24.3.16 it resumes functioning as before, calling the event listeners only once. After an upgrade to version 24.4.7 it keeps working.
Also after a vaadin:dance it keeps working.
Also we noticed that the urls in the browser bar were not changing anymore, while before they reflected the views paths.
The first time it happend a vaadin:dance fixed the urls issue but then again the listeners were called multiple times.
The second time the vaadin:dance didn’t do anything.
Nevertheless, even without the vaadin:dance, after some time and multiple restarts the event listeners break again.
So the behaviour seems pretty random and we can’t identify a pattern to investigate further, but we know that
- With version 24.4.7 sooner or later the lifecycle events are fired multiple times
- With version 24.4.7 sooner or later the urls are not updated during navigation, but it happens independently from point 1
- With version 24.3.16 the behaviour is fixed
We assume that the url not changing is a bug.
Instead we want to know if the multiple calls to the event listeners is the new default in case of url rewrite and we need to cope with it, or if it’s also a bug.
Thanks
Dario