-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fix flow issue #6349 #20255
Fix flow issue #6349 #20255
Conversation
Just to be sure: Is Flow erroneously setting random UI instances to the CurrentInstance value of UI, or is this happening only when the developer is calling |
HI @tepi , The overall problem is that whatever Note that a "previous operation" could be any of these:
As a result, when an enqueued session task invokes So it's not required that the first session task include an explicit call to Here is an example of a sequence of events demonstrating one way this could happen:
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me and safe. Excellent that you added the test, it indeed fails when this patch isn't in place.
Thanks for your contribution 👍
…20255) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349
…20255) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349
…20255) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349
…20255) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349
…20255) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349
…20255) (#20278) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349 Co-authored-by: Archie L. Cobbs <archie.cobbs@gmail.com>
…20255) (#20280) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349 Co-authored-by: Archie L. Cobbs <archie.cobbs@gmail.com>
…20255) (#20281) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349 Co-authored-by: Archie L. Cobbs <archie.cobbs@gmail.com>
…20255) (#20282) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349 Co-authored-by: Archie L. Cobbs <archie.cobbs@gmail.com>
…20255) (#20279) Commands enqueued by VaadinSession.access() in general have nothing to do with each other. The only thing they have in common is they share the same VaadinSession (and, by implication, VaadinService). Therefore, if command №1 invoked UI.setCurrent() and command №2 invokes UI.getCurrent(), command №2 should read null, not the random UI from command №1 that it has nothing to do with. Fixes #6349 Co-authored-by: Archie L. Cobbs <archie.cobbs@gmail.com>
…e in access() commands When executing access enqueued command, Flow clear all thread locals in CurrentInstance (vaadin/flow#20255), so VaadinRequest and VaadinResponse will never be available.
…) commands When executing access enqueued command, Flow clears all thread locals in CurrentInstance (vaadin/flow#20255), so VaadinRequest and VaadinResponse will never be available.
…) commands (#1829) When executing access enqueued command, Flow clears all thread locals in CurrentInstance (vaadin/flow#20255), so VaadinRequest and VaadinResponse will never be available.
This ticket/PR has been released with Vaadin 24.6.0.alpha2 and is also targeting the upcoming stable 24.6.0 version. |
Description
Commands enqueued by
VaadinSession.access()
in general have nothing to do with each other. The only thing they have in common is they share the sameVaadinSession
(and, by implication,VaadinService
).Therefore, if command №1 invoked
UI.setCurrent()
and command №2 invokesUI.getCurrent()
, command №2 should readnull
, not the randomUI
from command №1 that it has nothing to do with.Fixes #6349
Type of change
Checklist
JarContentsManagerTest.copyFilesFromJar_doNotUpdateFileIfContentIsTheSame
which has nothing to do with this change.