-
Notifications
You must be signed in to change notification settings - Fork 7
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
Singleton UnloadObserver should be thread-local #173
Comments
#173 UnloadObserver is now thread-local singleton
I believe that there is a problem with this approach (I may be reading the code wrong though). When a page is first served, it will be in thread 123 (say). The threadlocal variable will belong to that thread. Every time the page is updated, new threads are fired, but you are keeping a reference to the original thread, preventing 123 from being recovered. My suggestions would be to attach the listener to the UI object -- it is the UI object that is being unloaded. Maybe using ComponentUtil.setData https://vaadin.com/api/platform/14.2.2/com/vaadin/flow/component/ComponentUtil.html#setData-com.vaadin.flow.component.Component-java.lang.Class-T- |
this has been overridden by #178 |
The instance is shared across multiple instances of
UI
. It should probably be thread-local. There can only be one instance on the client-side, though.The text was updated successfully, but these errors were encountered: