Skip to content
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

XCOMMONS-1509: CancelableEvents are not propagated when they are canceled #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

surli
Copy link
Member

@surli surli commented Oct 17, 2018

Issue

https://jira.xwiki.org/browse/XCOMMONS-1509

Solution

Override matches(Event) in AbstractCancelableEvent.

Tests

Add a new unit test to check the new behaviour.

…eled

  * Override method matches in AbstractCancelableEvent
  * Add a new unit test to check the new behaviour
@tmortagne
Copy link
Member

tmortagne commented Oct 17, 2018

This does not fully fix the issue IMO. A cancellable event is an event which implement CancelableEvent, they don't have to extend AbstractCancelableEvent which is just a helper. For example this won't work with ActionExecutingEvent.

In my mind it was DefaultObservationManager job to check if an event is cancelled before continuing to call listeners.

@surli
Copy link
Member Author

surli commented Oct 17, 2018

In my mind in was DefaultObservationManager job to check if an event is cancelled before continuing to call listeners.

I understood, but I thought this implementation would allow more flexibility for this specific behaviour. i.e. if an user would want to trigger the listener no matter the state, then he can.

If we put it in the DefaultObservationManager, then we consider that this behaviour is fixed and cannot be changed.

Here it's really a choice to do IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants