fix: avoid reinserting pending custom catalog rows - #3225
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Red / green
Summary by cubic
Fixes custom-price Stripe Checkouts crashing on completion by omitting pending custom catalog rows when promoting a pending plan.
prices_id_keyconstraint crash before webhooks fired.billing.updatedandcustomer.products.updatedwebhook deliveries.Written for commit ca0d863. Summary will update on new commits.
Greptile Summary
This PR prevents checkout completion from attempting to insert custom catalog rows that were already stored when the purchase became pending.
Confidence Score: 5/5
The PR appears safe to merge, with the custom-row suppression matching the pending-plan persistence lifecycle.
Pending creation stores the complete set of custom catalog rows before checkout, and the promotion path now avoids inserting those same rows again while preserving all remaining customer-product actions.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Client participant Checkout participant DB participant Stripe participant Webhook Client->>Checkout: Attach custom-price plan Checkout->>DB: Persist custom rows and pending product Checkout->>Stripe: Create checkout session Stripe-->>Checkout: Checkout completed Checkout->>DB: Promote pending product Note over Checkout,DB: Omit already-persisted custom rows Checkout->>DB: Execute remaining billing actions Checkout->>Webhook: Send billing.updated Checkout->>Webhook: Send customer.products.updatedReviews (1): Last reviewed commit: "fix: avoid reinserting pending custom ca..." | Re-trigger Greptile