Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.x] Fix webhook order issue #1243

Merged
merged 3 commits into from
Aug 30, 2021
Merged

[13.x] Fix webhook order issue #1243

merged 3 commits into from
Aug 30, 2021

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Aug 29, 2021

This PR is an attempt at fixing the issue with the subscripion.updated webhook arriving sooner than the subscription.created webhook. What we'll do is create the subscription when it isn't yet created. This is a more safer way than delaying the handling by one second.
Should the susbcription.created webhook be handled later on, it won't be created twice since there's a check in the subscription.created handler.

I've also added two new unique indexes on stripe_id columns in the subscription tables. Honestly I don't know why these weren't there before.

I've tried this out and manages to confirm it fixes things for me in the situation that the subscription.updated webhook arrives first.

PS.: most of the changes in this PR are indentation changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants