Commit 7613d72
fix(billing): guard rejectIfTestCohort against nil h.db (dedup-test panic)
W0's rejectIfTestCohort runs models.IsTestCohort(ctx, h.db, teamID) at the top
of CreateCheckoutAPI/ChangePlanAPI. billing_checkout_dedup_test.go wires
NewBillingHandler(nil, ...) (db-independent — it only exercises the Redis SETNX
dedup guard), so the new DB query panicked on a nil *sql.DB in CI build-and-test.
Skip the cohort check when h.db == nil (prod always has a db). Targeted dedup +
cohort + checkout tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 76c68fd commit 7613d72
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
687 | 693 | | |
688 | 694 | | |
689 | 695 | | |
| |||
0 commit comments