-
Notifications
You must be signed in to change notification settings - Fork 176
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
onDetach() is not called after page closed and hearbeats stopped, even for a long time #14241
Comments
@bardyamomeni thanks for creating this issue. If "when a page is closed" means closing the browser's tab, I think this might not be exactly a bug, but more of an enhancement request since currently the support for this is not implemented yet, similar to #6293 and #13221. If this is about other circumstances or a regression, please elaborate more. |
@taefi What I think about sessions and UI's is that UI's could attach to a session and can be destroyed before the Vaadin session expires, so they could get detached sooner by an event like closing the browser tab. Currently I am attaching a RSocket connection to my main UI, so I want it to get destroyed when user closes the browser tab as soon as possible (maybe 3x or 4x times the heartbeat interval). The workaround for this is to set the session timeout to a small value like 30 seconds (for my usecase) to force the session and its UI's to detach and destroy. |
Another workaround (before the functionality is added officially to the platform) can be something like: https://cookbook.vaadin.com/notice-closed to take control of what should happen when the user closes a browser tab. Note that the |
Thanks Soroosh, I will take a look at the link. |
@bardyamomeni this has been fixed in Vaadin 24.1.0.alpha4 by implementing #6293. Now when you close a tab in browser or refresh a page, onDetach listener is called immediately. I close this ticket. |
Description of the bug
When a page is closed, heartbeats stop, but the UI is not destroyed and detached, even after a long time.
Expected behavior
the UI should get detached after a finite amount of time after the last heartbeat
Minimal reproducible example
Versions
The text was updated successfully, but these errors were encountered: