Skip to content

Prepaid code: a storage failure before the plan is created frees the code and asks to retry - #26256

Merged
kodjima33 merged 1 commit into
mainfrom
fix/prepaid-claim-release
Nov 24, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
fix/prepaid-claim-release

Conversation

@kodjima33

@kodjima33 kodjima33 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Follow-up to #26247, from its round 2 money review. When a prepaid or bundle code is redeemed, the code is claimed, then the reader's Google Play state is read once more before the no-card plan is created. If that second read failed with a storage error (not a typed refusal), the exception escaped: the route answered 500 and the claim stayed on the code with no plan created.

Now a storage failure at that point frees the code and answers the existing 503 try_again, so the reader can redeem again. If freeing the claim itself fails, the claim stays with the same reader and their retry resumes it, as before. Nothing is created in either case.

Play Billing is still off in prod, and the redemption switch is cohort with an empty cohort, so only the one throwaway test account can reach this path today.

Product invariants affected

none

How it was verified

  • backend/tests/unit/test_play_prepaid_code_entry.py: two new tests. A storage failure at the re-check ends in 503 try_again with the claim released and no Stripe create, and the same reader's retry then gets the plan. A failed release keeps the claim with the reader and still returns the typed refusal. Both fail without the fix.
  • test_play_prepaid_code_entry.py and test_prepaid_code_redemption.py: 123 passed.

Failure class

No fix: commits; no declaration required.

View guided diff Turn on auto-fix

…code and asks to retry

The second Google Play read happens with the code claimed. A storage error there escaped as a 500 and left
the claim on the code with no plan. It now releases the claim and answers 503 try_again; if the release
fails the claim stays with the same reader, whose retry resumes it.
@kodjima33 kodjima33 added the mux-proposal Mobile UX improver (MUX) proposal; waits for Nik's ship label Nov 24, 2026
@kodjima33
kodjima33 merged commit 0130d91 into main Nov 24, 2026
73 of 74 checks passed
@kodjima33
kodjima33 deleted the fix/prepaid-claim-release branch November 24, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mux-proposal Mobile UX improver (MUX) proposal; waits for Nik's ship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant