Webhook names query/inconsistent?

AI-generated summary

In a WordPress-related discussion titled ‘Webhook names query/inconsistent?’, TimMOz reports an issue where Discourse’s ‘post_edited’ webhook event fails with ‘The webhook event is not supported’. Reviewing the plugin code in sync-discourse-topic.php, they note that the supported events array (line 49) doesn’t include ‘post_edited’ or ‘post_recovered’. TimMOz resolves the issue by manually adding ‘post_edited’, ‘post_updated’, ‘post_recovered’, and ‘post_restored’ to the supported events array. angus thanks Tim for the fix and apologizes for the delayed response, noting they’ll update the plugin’s webhook event names in the next version. tobiaseigen initially notes the topic had no replies and tobiaseigen later asks if the issue is now resolved. The core problem was a mismatch between Discourse’s webhook events and the plugin’s supported events list.

Hi, I am new to this and just building a test setup and trying to get commenting web-hooks working between a test discourse and test wordpress install.

When I edit a post reply in Discourse, it triggers the webhook to fails with ‘The webhook event is not supported’, in response to a X-Discourse-Event: post_edited call from Discourse.

Looking at the plugin code in sync-discourse-topic.php line 49, it looks like it is expecting post_updated, not post_edited.

Not sure if something has changed or if it is something in my test discourse system.

If I add post_edited (and post_destroyed) to the code at line 49 it all works fine. The webhook is configured for post_created_event, post_edited_event, post_destroyed_event, post_recovered_event.

Latest wordpress (6.8.3), plugin (2.5.9), discourse (v3.6.0.beta1+124).

Thanks - any help appreciated.

Looks like your topic didn’t find any takers! Sorry about that. Were you able to figure out a solution on your own? If so, can you share it here?

Hi, thanks for that … I have resolved (or worked around) by adding some supported events to the code around line 49 of sync-discourse-topic.php …

    $this->supported_events = array(
        'post_created',
        'post_updated',
        'post_edited',
        'post_destroyed',
        'post_recovered',
    );

Looks like as this just triggers it to re-read, that was all that was needed.

Thanks for this Tim, and apologies for not responding sooner. I missed your topic somehow! We’re going to make an update to the webhook names in the next version of the plugin.

Is this issue resolved now?