#xandert.93

1 messages ยท Page 1 of 1 (latest)

bleak yarrowBOT
tawdry wagon
#

Hi ๐Ÿ‘‹

#

I'm using webhooks for the first time and for some reason, I'm getting a particular event running twice and calling the webhook twice as a result. Can anyone offer any assistance?

#

quoting here

hallow quarry
#

Oh thank you ๐Ÿ™‚

tawdry wagon
#

Webhook events from Stripe are triggered by actions related to your account. What event is firing twice?

hallow quarry
#

It's product.updated

#

If I update a product on Stripe dashboard, two separate requests are sent to the webhook

#

1 second apart

tawdry wagon
#

Yes that is just how the Dashboard saves products.

#

The first .updated event represents the values you charged.

#

The second .updated event is Stripe setting the product.updated timestamp to reflect when you last changed the product.

hallow quarry
#

Ahh I see

#

Thank you that makes more sense!

#

Is this mentioned in the documentation?

tawdry wagon
#

We don't explicitly call it out. However, you can see why each .updated event fired by examining the payload and specifically looking at the previous_attributes property. This will list that the values you changed were before the change.

hallow quarry
#

Yes I did notice that change actually

#

I just didn't understand...well

#

Inspecting them now, the previous_attributes.updated path changes in the first product.updated event as well as the second

tawdry wagon
#

Yes I'm seeing that in my test events as well.

hallow quarry
#

Is this expected behaviour?

tawdry wagon
#

I'm checking with a few colleagues on this

hallow quarry
#

Haha thanks. I'm integrating Stripe into my own database and just don't want to have the webhook called twice when once is, in theory, enough

tawdry wagon
#

Yes this is not ideal. I am going to file a bug report internally and hopefully get this addressed.

For now though, unless you are doing a lot of Product updates it probably won't seriously impact your integration.

hallow quarry
#

And do you think that Stripe should be applying my own changes as well as their timestamp update in a single event?

tawdry wagon
hallow quarry
#

Great thanks ๐Ÿ™‚

#

They've asked me for the ticket ID if you have one?

tawdry wagon
#

RUN_BILLX-4732

hallow quarry
#

Thanks!

tawdry wagon
#

Great. You should get updates as this is worked on

hallow quarry
#

Ha they're saying the ticket ID should be a number and that they don't use screen names ๐Ÿ˜…

tawdry wagon
#

Try just sending an email instead of talking via the chat. And do mention Snufkin.