Hi everyone,
right now by default we automatically filter out all events that are performed by the superadmin user so that the users doesn’t receive notifications related to the system. Of course it’s possible for a user to disable that filter, so they could receive those notifications, but it’s not the default behaviour.
Now, I’m wondering if we should keep this behaviour whenever the event is a TargetableEvent: such events are triggered to target specific people, either identified users or groups. When we use those TargetableEvent in general we do want the users to see them. However there is cases where it’s not easy to decide which context user to use for triggered those events, for example when those events are triggered from a scheduler.
The problem is that scheduler are executed with the user who created the scheduler page (in theory at least, see this ticket: [XWIKI-19765] Scheduler context author is always reset to guest when left empty - XWiki.org JIRA) but it’s possible that the page is created as part of an extension installed and that it’s been done with superadmin.
So my proposal would be that we skip the superadmin filter whenever the event is a TargetableEvent.