Hi all, I took the liberty to already create the PR, then you can see the impact on the code: https://github.com/xwiki/xwiki-commons/pull/49 Simon. On 10/17/18 9:09 AM, Thomas Mortagne wrote:
+1 to stopping event propagation when it's cancelled On Tue, Oct 16, 2018 at 6:07 PM Simon Urli <simon.urli@xwiki.com> wrote:
Hi everyone,
the current behaviour of the ObservationManager is to always triggers the listeners if it matches the events. Now regarding the CancelableEvents, the match is only done on the type of the event and some given filter rules, but never with its cancel status: if an event is cancelled, the matching listeners are always triggered.
I propose to change that behaviour, to trigger listeners only if the CancelableEvents are not canceled: basically, a cancelled event wouldn't match any listener.
My primary reason for wanting that change is that the current behaviour led to a bad UX: if an event triggers multiple questions, no matter if one is cancelled, all questions will be asked to the user.
Do you know if the current behaviour is required at some places? Else do you agree on changing it?
Simon -- Simon Urli Software Engineer at XWiki SAS simon.urli@xwiki.com More about us at http://www.xwiki.com
-- Simon Urli Software Engineer at XWiki SAS simon.urli@xwiki.com More about us at http://www.xwiki.com