craftcms / webhooks

Plugin for integrating Craft with Zapier and IFTTT.
https://plugins.craftcms.com/webhooks
MIT License
84 stars 12 forks source link

Integrating webhooks with Gatsby Cloud #28

Closed daniel-vc closed 4 years ago

daniel-vc commented 4 years ago

Hi there! We've been trialing the plugin for use with our test build runner, Gatsby Cloud but have encountered the below problems.

  1. After creating a new web hook in the CMS and creating a new news entry and hitting publish, it has worked as far as building in Gatsby Cloud, but after the first run it then no longer seems to work. (See attached images of the activity log and that of the entries in the CMS)
  2. Multiple build requests. See attached photo below of the multiple build requests sent from the plugin that Gatsby cloud cancels most and runs just one (rightly so). I've spoken to Gatsby Cloud and they say it's sending multiple requests from the plugin end, which haven looked at the activity log, it seems to send multiple for 1 publish. See attached screenshot of the web hook ‘scratch’ that has 7 posts when I only clicked publish once. Also, this only has the filter ‘Element is new’ applied (see attached photo of the web hook config). Again, to replicate the issue, this will only happen after the initial set up of a new web hook, each time.

How to replicate the issue.

  1. Set up a gatsby project in your Github. Fork the sample one i've set up here.
  2. Setup a gatsby cloud account at gatsbyjs.com ignoring (at this setup prompt) the sections to add cms integrations and environment variables.
  3. Have a test CraftCMS admin site handy with the plugin and graphql enabled with an endpoint setup
  4. Add your Data endpoint token as a variable called GATSBY_GRAPHQL_TOKEN to the Build Environment Variables and Preview Environment Variables in the site settings -> General -> Environment Variables section.
  5. Copy the builds Webhook token from the webhooks site setting section and paste into the set up of a new webhook in Craft. Set up the webhook with same settings as provided in the attached screenshot below and save.
  6. With the webhook tokens setup in Craft CMS and Environment variables setup in Gatsby Cloud, try publishing a new article in craft and test the outcomes.

Any questions, feel free to give me a shout 👍


When plugin does send a request - get multiple build requests

Data builds when working

Activity log shows 7 sent requests from 1 publish with webhook 'scratch'

Activity Log

To further show builds not working - these are Latest entries in CMS don't correspond to the output in my test page (see next screenshot)

Entries in CMS

Current entries showing on the page. Latest entry should be 'Lets try today'

Data

Last built in Gatsby cloud which shows the plugin not receiving any requests for over 21hours despite sending multiple requests from the Craft plugin.

Last built

Webhook settings in the CMS

Plugin Settings
brandonkelly commented 4 years ago

Do you have multiple sites? If so, how many?

daniel-vc commented 4 years ago

It's just 1 example site at the moment.

brandonkelly commented 4 years ago

Can you send a database backup and your composer.json + composer.lock files over to support@craftcms.com, along with steps to reproduce?

daniel-vc commented 4 years ago

I provided the steps to re-produce in my original post...

Will send the files over now...

daniel-vc commented 4 years ago

Hey @brandonkelly,

Just checking in to see if there's any update on this yet? Did send you an email but haven't heard anything back yet.

Thanks 👍

brandonkelly commented 4 years ago

@daniel-vc Sorry, been slammed. It’s still in my inbox and will get to it as soon as I can.

brandonkelly commented 4 years ago

We just released Webhooks 2.3.0, which adds a new Debouncing feature. I suspect it will help solve your issue.