Webhook not triggered on delete event


(Coin-coin le Canapin) #1

Hi.
The description of the Post Event is:

When there is a new reply, edit, deleted or recovered.

However, while it is triggered when adding or editing a reply, the webhook is not triggered when a reply is deleted. Am I missing something?


#2

(We are on the same team).

Small precision: Discourse 2.0.0.beta2 ; and it would seem post_recovered works.


(Vinoth Kannan) #3

Name of the post delete event is post_destroyed. I guess you are wrongly expecting to receive the webhook for post_deleted event.


#4

Thanks for your answer, I’m not well familiar with Discourse.

Is the webhook should fire post_destroyed event once clicked on delete this post button? If so, it’s not triggered. post_recovered works fine though.

Right now I’m admin and delete removed posts after option is set to 0.

Am I missing something?

EDIT: Tried with a regular user and deleting its own post, and nothing happens as well.


(Vinoth Kannan) #5

As per the above code it should work. Please check recheck your code. If the problem persist I can investigate it on Monday.


#6

I’ve seen the code, and I’m quite confused as well.

Right now, I’m not checking through some code, I’m looking directly at the Discourse events list.
I’ve tried many times to make sure I did not miss it, but really nothing happens on post deletion.

Let me know If I can do something to help!

EDIT: I’ve tried to disable any code linked to Discourse (wordpress extension) since I was not sure you would get an event if it fails. I got an event for all except deletion. Not sure what’s happening.

EDIT2: I tried on fresh installation and it still happens, here some screenshots:


Event 2, 3, topic creation and first message:


A second message:

Edited the second message:

I deleted the message as showed in the first screenshot and as you can see, nothing happened.

Once I restored it:


(Vinoth Kannan) #7

It is now fixed as per the below commit. Can you please confirm by testing it with latest version of code.


#8

Thanks, Vinoth! :grinning:

I’m glad I was not crazy. Finally, I see the event:

How it’s possible that no one reported this before!


(Jeff Atwood) #9