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
Detach listeners not called when closing tab after resynchronization #19023
Comments
I tried to debug this myself and I found out that when closing the tab after resynchronization, when flow/flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Lines 450 to 460 in 20ab69e
It would be set to true in |
This ticket/PR has been released with Vaadin 24.4.0.alpha19 and is also targeting the upcoming stable 24.4.0 version. |
This ticket/PR has been released with Vaadin 24.3.10. |
Description of the bug
In recent versions, Vaadin uses the beacon API to inform the server when a tab is closed, so the server can immediately call all detach listeners to clean up resources.
I noticed that the listeners are not called when a resynchronization happened before.
Expected behavior
When the tab is closed, and a beacon request is sent, detach listeners should fire, regardless of whether resynchronization has happened before in this tab or not.
Minimal reproducible example
Consider this example:
It shows a simple page with two buttons. The first button triggers resynchronization, the second one removes the first.
There are several detach listeners that log something to System.err so we can see whether they have been called.
To reproduce:
During resynchronization, all listeners will log that they have been called while the UI was not closing (as discussed in #18443).
Then, when closing the tab, all listeners should be called agein, this time with
UI.isClosing = false
, but they aren't.Interestingly, this issue really seems to be specific to closing the tab.
When you click on "Remove", the detach listener of the "Resync" button is always triggered, regardless if resynchronization has happened before or not.
Versions
The text was updated successfully, but these errors were encountered: