[BUG] Adding and removing webhooks can stop callbacks from being made to a remaining webhook.

89 views
Skip to first unread message

Guus der Kinderen

unread,
Nov 12, 2015, 8:33:24 AM11/12/15
to Eventbrite API
While experimenting with the Webhook API, I ran into an issue that I believe is a bug on your end. The issue can escalate into a situation where callbacks are not done at all, even when a valid webhook is configured.

A little bit of background
We are experimenting with both the event-specific, as well as the 'catch-all' webhooks. The reasoning for this is that for some callbacks, we want to execute generic code, while for others, we want to update entities on our end. By configuring the webhook URL to include our entitity identifier, we avoid having to do lookups (to find out which Eventbrite identifier relates to our entity identifier). Additionally, our entities can be created and deleted: we want to be able to add and remove webhooks as needed. Finally, we foresee a scenario in which more than one of our entities relate to the same Eventbrite event. As a result, we're experimenting with multiple webhooks on the same event.

Reproduction scenario
(without exception, I'm creating webhooks that will act on all actions)

I've started off with one 'catch-all' webhook. When placing an order, this triggers our backend as expected.

Next, I've added two more webhooks, each of these are event specific. As I had just one event to test against, I used the same event for both webhooks.

I was wondering what amount of callbacks this would lead to. I figured that one of the following would occur (in order of likelyhood):
  • three - there are three applicable webhooks, so each of them gets fired.
  • one - indicating that you detect that that the same notification needs not to be send to the same callback URL more than once.
  • two - as it's easier to detect the 'event-specific' duplicates, Eventbrite sends one event-specific callback, and one catch-all
As it turned out, something else happened. I did get two callbacks, but they were addressed to each of the event-specific callbacks. The 'catch-all' did not get anything.

Experimenting further, I deleted both event-specific webhooks, leaving the catch-all in place. Now, I don't get any callbacks any longer. Auch!

Reproduction (detailed)
I am adding and removing webhooks through your website at https://www.eventbrite.com/myaccount/webhooks (as opposed through the API endpoints).


I believe that this scenario is longer than that is strictly needed to reproduce the problem. However, I'm hoping that the additional steps give you more valuable data that you can use to debug.

First, I've removed all pre-existing webhooks from my configuration, and created one new event on Eventbrite.


Next, I add a 'all actions for all events' webhook. GET https://www.eventbriteapi.com/v3/webhooks/?token=REDACTED now returns this (as expected):

{
  "webhooks": [
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84419",
      "user_id": "155697204300",
      "created": "2015-11-12T04:40:47Z",
      "event_id": null
    }
  ],
  "pagination": {
    "object_count": 1,
    "page_number": 1,
    "page_size": 50,
    "page_count": 1
  }
}



I published the event. The logs of my local endpoint:

[2015-11-12T12:48:02.886Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T12:48:02.886Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "event.published",
        "user_id": "155697204300",
        "webhook_id": "84419"
      },
    }



Next, I add a new order. My logs (as expected) record the callback:

[2015-11-12T12:48:50.066Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T12:48:50.066Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "order.placed",
        "user_id": "155697204300",
        "webhook_id": "84419"
      },
    }



Next, I create an additional webhook, this time not a catch-all, but an event-specific webhook. GET https://www.eventbriteapi.com/v3/webhooks/?token=REDACTED now returns two webhooks (as expected):

{
  "webhooks": [
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84421",
      "user_id": "155697204300",
      "created": "2015-11-12T04:50:35Z",
      "event_id": "19529040887"
    },
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84419",
      "user_id": "155697204300",
      "created": "2015-11-12T04:40:47Z",
      "event_id": null
    }
  ],
  "pagination": {
    "object_count": 2,
    "page_number": 1,
    "page_size": 50,
    "page_count": 1
  }
}



Next, I again add a new order. My logs record one callback (I'm not sure what the intended behavior is - as both of my webhooks have similar endpoint URLs, I'm satisfied with just one callback. The webhook_id value provided in the payload of the callback indicates that it is the 'event-specific' webhook that is triggered. The 'catch-all' webhook is not triggered):

[2015-11-12T12:52:34.469Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T12:52:34.470Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "order.placed",
        "user_id": "155697204300",
        "webhook_id": "84421"
      },
    }



Next, I create The third webhook, again one that is event-specific. GET https://www.eventbriteapi.com/v3/webhooks/?token=REDACTED now returns all three webhooks (as expected):

{
  "webhooks": [
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84425",
      "user_id": "155697204300",
      "created": "2015-11-12T04:56:44Z",
      "event_id": "19529040887"
    },
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84421",
      "user_id": "155697204300",
      "created": "2015-11-12T04:50:35Z",
      "event_id": "19529040887"
    },
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84419",
      "user_id": "155697204300",
      "created": "2015-11-12T04:40:47Z",
      "event_id": null
    }
  ],
  "pagination": {
    "object_count": 3,
    "page_number": 1,
    "page_size": 50,
    "page_count": 1
  }
}



Next, I again add a new order. My logs now record two callbacks (by looking at the webhook_id values, it's clear to see that both event-specific webhooks are triggered, but not the 'catch-all' webhook):

[2015-11-12T12:57:57.488Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T12:57:57.489Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "order.placed",
        "user_id": "155697204300",
        "webhook_id": "84425"
      },
    }
[2015-11-12T12:57:57.832Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T12:57:57.832Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "order.placed",
        "user_id": "155697204300",
        "webhook_id": "84421"
      },
    }



Next, I removed the last webhook that I added. GET https://www.eventbriteapi.com/v3/webhooks/?token=REDACTED now returns two webhooks (as expected):

{
  "webhooks": [
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84421",
      "user_id": "155697204300",
      "created": "2015-11-12T04:50:35Z",
      "event_id": "19529040887"
    },
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84419",
      "user_id": "155697204300",
      "created": "2015-11-12T04:40:47Z",
      "event_id": null
    }
  ],
  "pagination": {
    "object_count": 2,
    "page_number": 1,
    "page_size": 50,
    "page_count": 1
  }
}


Next, I again add a new order. My logs now record one callback - to the event-specific one, not the catch-all one:

[2015-11-12T13:05:26.554Z]  INFO: queue/15204 on laptop-guus: [API] Content: Eventbrite callback triggered for event bb76fcc7-83b0-4303-9a34-9ce9bc564b7a
[2015-11-12T13:05:26.554Z] DEBUG: queue/15204 on laptop-guus:
    [API] Content: Eventbrite callback payload: {
      "eventId": "bb76fcc7-83b0-4303-9a34-9ce9bc564b7a",
      "config": {
        "action": "order.placed",
        "user_id": "155697204300",
        "webhook_id": "84421"
      },
    }



Next, I removed the remaining 'event-specific' webhook. I noticed that the "recent requests" for that webhook lists three request (while the "recent requests" for the catch-all lists two):

GET https://www.eventbriteapi.com/v3/webhooks/?token=REDACTED now returns the one remaining webhook (as expected):
{
  "webhooks": [
    {
      "actions": [
        "event.published",
        "event.unpublished",
        "order.placed"
      ],
      "id": "84419",
      "user_id": "155697204300",
      "created": "2015-11-12T04:40:47Z",
      "event_id": null
    }
  ],
  "pagination": {
    "object_count": 1,
    "page_number": 1,
    "page_size": 50,
    "page_count": 1
  }
}

When I now place another order, my logs do not record any callbacks. As I have at least one valid webhook remaining, this is disturbing. The 'catch-all' webhook should have been triggered.

I've did some further tests. When adding another 'catch-all' webhook, again, not one callback is received. When I then add a new 'event-specific' hook, I do get exactly one callback.
Reply all
Reply to author
Forward
0 new messages