Webhook名称查询/不一致?

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.

2 个赞

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.

2 个赞