revert: 30-day expires_at on Stripe Checkout Sessions (#490) #495
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!495
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "493-revert-490-ttl-code"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #493
Summary
Reverts PR #490 (squash commit
223c5da) which addedexpires_at = now + 30 daysto all 8 Stripe Checkout Session call sites. Stripe capsexpires_atat 24 hours, so every checkout flow returnedInvalidRequestErrorin prod for ~60 minutes on 2026-04-17. The deployment overlay was already rolled back via pal-e-deployments#131; this PR removes the broken code from basketball-api main so the next merge does not rebuild and re-deploy the broken image. Scope is the revert only — re-implementation is tracked under spike #489 and follow-up #494.Changes
223c5da("fix: set 30-day expires_at on all Stripe Checkout Sessions (#488) (#490)") viagit revert --no-editCHECKOUT_SESSION_TTL_SECONDSfromsrc/basketball_api/config.pyexpires_at=kwarg from all 8stripe.checkout.Session.create(...)call sites inroutes/admin.py,routes/checkout.py,routes/jersey.py,routes/register.py,services/tournament_checkout.pytests/test_checkout_session_ttl.py(536 lines of mock-based assertions that gave false confidence — mocks do not enforce Stripe's server-side 24h cap)docs/tournament-billing-runbook.mdTTL sectionTest Plan
ruff check .passesruff format --check .passes (123 files)test_jersey_reminder.pyx4,test_westside_streamlit_ro_role.py::test_migration_file_exists,test_first_payment_email.py::test_send_first_payment_email) also fail onmainat223c5da— confirmed pre-existing, not introduced by this revertgit diff main...HEADconfirms every +line in223c5dais removed and every -line is restoredupdate-kustomize-tagstep inpal-e-deploymentsbumps to the new SHA; verify deployed pod no longer hasCHECKOUT_SESSION_TTL_SECONDSset and checkout flows work against live StripeReview Checklist
expires_atcode, so the update-kustomize-tag step can no longer overwrite the revert in pal-e-deploymentsRelated Notes
forgejo_admin/basketball-api#488— original ticket (closure misleading; root problem unsolved)forgejo_admin/basketball-api#489— architecture spike (Payment Links vs lazy-mint); load-bearingforgejo_admin/basketball-api#490— the PR being reverted (squash commit223c5da)forgejo_admin/basketball-api#493— this revert ticketforgejo_admin/basketball-api#494— follow-up re-implementation (scope belongs there, not here)forgejo_admin/pal-e-deployments#130, #131— deployment-layer revert that restored prodfeedback_retrieve_before_theorize.md— the missing sanity check that allowed a mock-only test to gate the mergePR #495 Review
DOMAIN REVIEW
Python / FastAPI / Stripe. Pure revert of squash commit
223c5da(PR #490). Verified against the expected inverse:expires_at=int(time.time()) + CHECKOUT_SESSION_TTL_SECONDSremoved from:services/tournament_checkout.py:95(blessed helper)routes/jersey.py:309routes/checkout.py:264, 428, 566routes/register.py:1397, 1443routes/admin.py:2025import timeremoved from all 5 modules that added it for #490 (admin.py,checkout.py,jersey.py,register.py,services/tournament_checkout.py). No dangling imports — confirmed by checking local basketball-api checkout at main pre-#490: none of these modules usetimefor anything else (the onetimereference incheckout.py:364is a comment, not a symbol).CHECKOUT_SESSION_TTL_SECONDSconstant deleted fromsrc/basketball_api/config.pyalong with its 15-line docblock. All 5 import sites also cleaned up.tests/test_checkout_session_ttl.pyfully deleted (536 lines). This was the right call — Ava-tier lesson: mock-based assertions against Stripe-server-side constraints give false confidence.issues #484 + #488back toissue #484. Exact textual inverse of #490's runbook changes.No accidental extras. No re-implementation. No drive-by edits.
BLOCKERS
None.
NITS
None. This is the right shape for an emergency revert: scope-restricted to the inverse of the broken PR, re-implementation explicitly deferred to spike #489 and follow-up #494. PR body cleanly distinguishes "restore prod" (already done via pal-e-deployments#131) from "prevent rebuild-and-redeploy" (this PR's job).
SOP COMPLIANCE
493-revert-490-ttl-code)ruff check+ruff format --checkpass per PR bodyPROCESS OBSERVATIONS
feedback_retrieve_before_theorize.mdis the right lesson to link. Mock tests against a Stripe server-side constraint (24hexpires_atcap) gave false-positive coverage. Future regression tests for Stripe integration constraints need a real Stripe test-mode call or a typed SDK assertion, notMagicMock.call_args.VERDICT: APPROVED