Webhooks feedback

Full disclosure: I didn’t checkout and live-test this branch.

Awesome work, I am looking forward to use this feature. Some early feedback/questions:

  • Why isn’t this a plugin (is it too deeply integrated in the core)? I am not really comfortable with testing a custom branch as it means a full manual install until it gets merged (a beta/unstable plugin would be much more lightweight).
  • Some ideas for other hooks (that don’t seem to exist now after reading the docs):
    • edit-post which also triggers when a post gets edited.
    • watch-first-post which is like edit-post but for every first post in a topic.
  • Filters on top of hooks which match against the payload json to restrict the trigger. Agreed, this can be implemented on the remote side of the webhook but sometimes it could save a lot of bandwith. This could be paired with an output filter which selects the wanted json fields (or produces some other structure based on the initial payload). This could be implemented with mongodb-style json querying.

I just looked at the commits and discovered the existence of DiscourseEvent. Is there any documented list of such events or am I supposed to grep the source code for DiscourseEvent.trigger? :turkey:
Edit: So I grepped and there are not so much such events. I don’t really understand “post validation” but the validate_post event might be relevent for my edit-post hook proposition.

2 Likes