[MGNLUI-3532] LocalTaskDispatcher fires event always under user that causes the event Created: 21/Aug/15  Updated: 09/Mar/21  Resolved: 09/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Adi De Masi Assignee: Unassigned
Resolution: Obsolete Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
supersession
is superseded by MAGNOLIA-7704 Asynchronous context implementation Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

The LocalTaskDispatcher has the user as property that should receive the task.

The dispatcher then fires an event on the eventbus and sets a new context with the correct user and locale, but only if there was no instance in MgnlContext (=if MgnlContext.hasInstance() returns false).

This is not the case, however. MgnlContext.hasInstance() will return true and therefore the context is not changed. The TaskEvent therefore will be executed in the context of the user, that has sent the event, not the user that should receive it.

E.g. this leads to problems with the ExternalUserManager. This manager is only capable of returning the current logged in user. If this userManager is access later while this TaskEvent is processed, it will return null, when the current user is accessed.


Generated at Mon Feb 12 09:07:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.