I have a webhook setup for post events. The only event I do not appear to see is post_destroyed. I have testing deleting and restoring multiple posts and I see every post_recovered event, but I do not see any events for the post being deleted.
To reproduce, create a webhook and enable post events. Delete a post on a topic that would trigger that webhook and see no delete event created.
No, this is working fine for me in latest version. I’m able to see triggered post_destroyed events in URL /admin/api/web_hooks/1/events. @thisnthat did you checked the events list page?
I will recommend you to look at the URL /admin/api/web_hooks/WEBHOOK_ID/events for more info. If a triggered webhook event is failed then it will have the details. Also look at the /logs at the time of post_destroyed event. If you provide more details about the fail it will help me to debug the issue.
I have reviewed /admin/api/web_hooks/WEBHOOK_ID/events and the details of the events are in my previous post. Event id 90 was apost_ create, 91 post_recovered, 92 post_edited, 93 post recovered.
I tested again this morning. I reviewed the logs rails/production.log, rails/production_errors.log, rails/unicorn.stderr.log, rails/unicorn.stdout.log,
This is a snippet from the access logs for the previously mentioned events
I also checked the /logs/ page and there was nothing related to this. To be sure I cleared the logs and tested it again and no error logs were generated.
I was able to track down the cause of this issue. The webhook I am using depends on a specific tag.
The issue appears to be in lib/post_destroyer.rb. tag_ids is not set on delete webhook events like it is when going through enqueue_post_hooks on the WebHook class. After making the following change, my destroy events started working correctly.