Post webhook fires two times on post_edited for first post in a topic

First, it fires an event without any changes in the payload (thus the post as it is now) and then a second one with the changes.

This applies only for changes to the first post in a topic.

Expected: Only fire one event, with a payload containing the changed post.

Or is this working as intended? If so, that’s confusing for the receiving endpoint as a change is signaled, but the payload contains no changes at all and you can’t figure out if this is a bogus change event or not (as no info is given in the payload).

It works as intended on post_created and for changes to subsequent posts in a topic, only one event.

Anybody? This drives me crazy working with the post webhook for first posts.

2 Likes

I am not sure if this is intentional or not, @vinothkannans do you know ?

1 Like

It’s at least confusing for the received endpoint, as there is no single use case for it. Should be one event, not two.

I fixed this issue in below PR. Since it’s changing the way how the topic web hooks are triggered I have to make sure the change again before merging it.

https://github.com/discourse/discourse/pull/10590

3 Likes

Awesome, thanks @vinothkannans, our post webhook endpoint will love this :+1:t2:

1 Like