Jump to content

For 5.10beta1, Webhooks cache must not exist for incoming webhook to work


Recommended Posts

Posted (edited)

Blesta: 5.10beta1
PHP: 8.2.17
OS: Debian (stable, bookworm)

Attached is a zip file of a plugin called webhhook_incoming_example, link webhooks_incoming_example.zip, that can be used to demonstrate an incoming webhook.

Problem is the webhook only works ONCE after the webooks cache has been deleted, such as with command:

rm cache/?/plugins/webhooks/*

After calling once the cache is recreated and just an empty answer is returned, while the cache exists.

This suggets there is a Webhooks cache bug. Whatever is recorded and read back from the cache is not reconstructed to its original pre saved form.

If an oncoming GET webhook has been setup with callback 'webhooksexampleadd', then the following URI path can be used to add two integers a and b with values 1 and 2: 
/admin/plugin/webhooks/trigger/index/webhooksexampleadd?a=1&b=2

The answer after cache is deleted is returned as
{"__return__":{"a":1,"b":2,"c":"a (1) + b (2) = c (3)"},"a":1,"b":2}

The answer, until cache is deleted again is
[ ]

There is more information with images in topic at 

 

Edited by John Heenan
clarity
Posted

The name of the event to form an incoming callback for in Webhooks is
WebhooksIncomingExample.add

The cache has to be deleted twice: once to even view the event to register the callback, a second time to successfuly obtain a result (with repeat deletion). More informration in topic linked to in above post.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...