Missing node.deleted in branch master (sometimes)

Enonic version: 7.11.1/7.10.3
OS: OS X/Linux


I’m coming up with an event listener to fire messages to an external API every time the editor either publishes or unpublishes/deletes something, then listening to “node.pushed” and “node.deleted” (this one from branch master) events. One thing I noticed today while testing it, though, is that sometimes the “node.deleted” event would be missing. After removing the branch master condition, I’ve seen it sometimes getting a deleted+draft only and other times deleted+draft + deleted+master events (of course, every test with published contents).
Is there a condition to when the system should not dispatch a “node.deleted” from branch master, when completely deleting a content? Or is it possible that as soon as a listener is already running it won’t be re-triggered by another event (hence getting the task duplicated)?
Unfortunately it also seems not easy to reproduce it.

So far, today, on all tests I got only the draft event, even though the tree is published. The listener calls log.info(JSON.stringify(event)) as soon as it’s triggered.

So, today I’m testing the new feat, and the delete events for some contents still seem to go missing. At first I only got for 4 out of 13, then only the leaf contents (testing publishing and unpublishing two 13-elements trees). Later on I got all 13 events, but shortly after just 4 again.
I started recording when the listener receives a push/update or a delete. The image are all contents that were published (these events seem to be always correct) but “weren’t deleted” (events missing).

Right after the delete events, I get all 13 updates from branch draft. The event log is the listener’s first line and it’s registered for node.* and localOnly is set to true.

The content tree after the unpublish.
Captura de tela de 2023-04-20 10-32-31

Is it possible a listener misses events if it’s busy and still running by the time the event is triggered, or perhaps any other way? Since I have DB operations in this listener, I can only guess there’s some sort of race condition issue going on there.

Edit: the customer just complained the event-dependent notification they expected for an important content tree never arrived after unpublishing it.

I need to say that in 7.12 version we have improved reliability of content-node events. So first thing to do is to upgrade your system to XP our latest 7.12.2

1 Like

I discussed this with the customer and, although we’re usually not following the latest XP release, we’ll try it when possible.