-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Fix incognito pm update #10960
base: main
Are you sure you want to change the base?
Fix incognito pm update #10960
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some comments to explain what problems we're solving with the abortController?
Solves a case where the hook is called again during component render and a new payment intent is created with same parameters by the previously in-flight mutation call. This causes an unused payment intent on Stripe and rerenders the form with new state. |
// If this hook is called again during component rerender and we still have a in-flight payment intent, abort it. | ||
// Without the abort controller, we can get another payment intent created for a previous render that will be unused | ||
// and will make the form render again with the setStripe, setPaymentIntent state changes. This also prevents generating | ||
// to many incomplete payment intents on stripe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// to many incomplete payment intents on stripe | |
// too many incomplete payment intents on stripe |
Resolves opencollective/opencollective#7770