Skip to content

Refine logic to update membership information #4686

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

Open
ERosendo opened this issue Nov 13, 2024 · 1 comment
Open

Refine logic to update membership information #4686

ERosendo opened this issue Nov 13, 2024 · 1 comment

Comments

@ERosendo
Copy link
Contributor

Our code is designed to process and update membership records only in response to SUCCEEDED webhook notifications. However, while debugging an issue with a membership, I noticed that Neon can send CreateMembership webhooks with a PENDING status, followed by UpdateMembership webhooks with a SUCCEEDED status. This unexpected sequence causes our system to:

  • Ignore the initial CreateMembership: As it has a PENDING status, our logic disregards it.

  • Misinterpret the UpdateMembership event: This webhook, while having a SUCCEEDED status, is linked to the previously ignored membership webhook. Our code incorrectly assume it's a redundant update and does not process it.

This behavior puzzled me. However, upon comparing the webhook content, I realized that the initial CreateMembership event's PENDING status was a result of Neon's ongoing payment processing. Subsequent webhooks confirmed the payment was successful.

I had assumed that Neon sent the initial CreateMembership event after processing the payment, as its status was always SUCCEEDED. It's possible that Neon took longer than usual to process the payment for this specific account and sent the webhook during this processing time.

@mlissner
Copy link
Member

Oof, but thanks for filing. Is there a simple solution?

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

No branches or pull requests

2 participants