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).
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.