vend / developer-wiki

5 stars 0 forks source link

Isolate Webhook events that affect stock (race condition issue) #6

Closed achadee closed 8 years ago

achadee commented 8 years ago

You guys trigger multiple webhook events per single action. for example

Some suggestions:

pzurek commented 8 years ago

There are a few "layers" to this suggestion. First, let's tackle the obvious:

Now, you are right about race conditions. There is no good way to determine the order in which events were triggered and delivered. We recognise that and that's why we have introduced the concept of versioning in the next iteration of the API. It is primarily used for pagination (http://docs.vend.apiary.io/#introduction/pagination) but the version number on an object can also be used to find out if the event received from the webhook does, in fact, contain the latest version of the resource. The next version of webhooks will also include version numbers.

achadee commented 8 years ago

Thanks for that clarification, maybe we are doing something funky with our post requests. I'll review the code later today!

+1 to the versioning that will be awesome