fix(payments-next): PaidInvoiceOnFailedCartError: Paid invoice found on failed cart#20708
Open
elizabeth-ilina wants to merge 1 commit into
Open
fix(payments-next): PaidInvoiceOnFailedCartError: Paid invoice found on failed cart#20708elizabeth-ilina wants to merge 1 commit into
elizabeth-ilina wants to merge 1 commit into
Conversation
elizabeth-ilina
commented
Jun 8, 2026
| }); | ||
| } | ||
|
|
||
| // TODO: remove these after testing |
Contributor
Author
There was a problem hiding this comment.
Todo: remove before merging.
elizabeth-ilina
commented
Jun 8, 2026
| errorReasonId, | ||
| }); | ||
|
|
||
| // TODO: remove after testing |
Contributor
Author
There was a problem hiding this comment.
Todo: remove before merging.
…on failed cart Because: * When a customer checks out with PayPal in tab 1 and then sends a second request from tab 2 while the first cart is almost done processing, they end up charged by the first tab while the second tab's stale cart version throws and transitions the cart into FAIL for both tabs. The customer sees the error page, tries to subscribe again, and finds they are already subscribed to the product. This commit: * Checks if the cart is already processing, and, if it is, prevents a second request from failing a cart that another request is actively processing, so the owning request finishes rather than both tabs erroring out. Closes #[PAY-3664](https://mozilla-hub.atlassian.net/browse/PAY-3664)
7aef9f0 to
85907be
Compare
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.
Because
This pull request
Issue that this pull request solves
Closes #PAY-3664
Checklist
Put an
xin the boxes that applyHow to review
STRs and screen recordings:
Using the current console logs and timeouts (I'll remove them before merging):
What happens: Tab 1 charges --> Tab 2 arrives with stale cart version --> Tab 2 puts cart in FAIL --> Tab 1's finishCart fails → both tabs see an error, but the customer is subscribed.
Video attached:
Screen.Recording.2026-06-08.at.2.52.59.PM.mov
After the fix, instead of both tabs failing in step 6, they succeed:
Screen.Recording.2026-06-08.at.12.30.30.PM.mov
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.