Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
2.0.0
-
None
-
DevX 28
-
3
Description
Steps to reproduce
- Create a webhook definition file, with an event definition. Push it to GIT
- Test that it's triggered properly, publishing/unpublishing content, depending on the event type declared.
- Change the event type to the other one (Published <-> Unpublished). Push it to GIT.
- If content is published or unpublished, both type of events are triggered.
Expected results
When event type is changed to the other one, existing subscriber should be removed.
Developer notes
The problem occurs because on method info.magnolia.webhooks.registry.WebhookDefinitionRegistry#onUpdate, when it is invoked with the webhook definition change (event type), lastValidDefinitions, already contains it (it's supposed to have only the previous definition). The only place where lastValidDefinitions is updated, is at the end of method info.magnolia.webhooks.registry.WebhookDefinitionRegistry#updateProvider, which hasn't yet been executed when the first method one is invoked (in fact, it's being executed in the first method line, inside a loop).
For QA:
- Test also on different environments
Checklists
Acceptance criteria
Attachments
There are no Sub-Tasks for this issue.