Repository navigation
fix: register UI event listeners through UIInitListener - #530
Merged
Merged
Conversation
Flow 25.3 (vaadin/flow#25268) moved the service listeners onto the new VaadinServiceEventBus. BootstrapHandler now fires a UIInitEvent through the bus instead of calling VaadinService.fireUIInitListeners, which is deprecated for removal and no longer invoked by Flow. The extension attached its CDI event forwarding listeners to the UI from an override of that method, so they were never registered: no navigation, poll or UI detach event reached CDI observers, and @RouteScoped beans got no context because RouteScopedContext observes BeforeEnterEvent and AfterNavigationEvent. UIEventListener now implements UIInitListener and attaches itself to the UI before firing the CDI UIInitEvent, and is registered with addUIInitListener instead of a lambda. Only APIs available since Flow 1.0 are used, so the fix works on both Flow 25.2 and 25.3. The unit tests fire the event the way Flow does, through the service event bus, reached reflectively so that they still compile and exercise the same code path against Flow 25.2, where the bus does not exist yet.
Test Results144 tests +1 144 ✅ +1 2m 32s ⏱️ +3s Results for commit aec1a95. ± Comparison against base commit 13cb33b. This pull request removes 2 and adds 3 tests. Note that renamed tests count towards both. |
caalador
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flow 25.3 (vaadin/flow#25268) moved the service listeners onto the new VaadinServiceEventBus. BootstrapHandler now fires a UIInitEvent through the bus instead of calling VaadinService.fireUIInitListeners, which is deprecated for removal and no longer invoked by Flow.
The extension attached its CDI event forwarding listeners to the UI from an override of that method, so they were never registered: no navigation, poll or UI detach event reached CDI observers, and @RouteScoped beans got no context because RouteScopedContext observes BeforeEnterEvent and AfterNavigationEvent.
UIEventListener now implements UIInitListener and attaches itself to the UI before firing the CDI UIInitEvent, and is registered with addUIInitListener instead of a lambda. Only APIs available since Flow 1.0 are used, so the fix works on both Flow 25.2 and 25.3.
The unit tests fire the event the way Flow does, through the service event bus, reached reflectively so that they still compile and exercise the same code path against Flow 25.2, where the bus does not exist yet.