Repository navigation
fix(billing): release audit follow-ups for v0.9.66 - #10433
Conversation
- migrations 0471, 0473 and 0474 are replay-safe after 0470's embedded COMMIT - a Team upgrade is refused while the personal Pro plan is still trialing - ending a trial early never starts a past-due plan on a declined card, and refuses a cancelled trial - a credit balance that can't be read fails a hosted-key run as a fault, not as the free plan, so a schedule is not disabled for it - the Web Search refusal no longer offers BYOK, which Search does not support - annual seat-months advance only from the count they were computed from, so racing syncs cannot rebase twice - a plan switch keeps the headroom read before Stripe applied it, and records the period Stripe restarted on an interval change - payment-succeeded skips the open-invoice listing for an unblocked payer - reuse formatMonthlyPlanPrice, AVERAGE_MONTH_MS and the deletion's owner id; parallel independent reads
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The changes since the last review appear safe to merge. SummaryThis PR fixes billing follow-ups around migration retries, trial payments, hosted keys, and plan allowances. Since the last review:
No new actionable issues were found in these changes. Reviews (4) · Last reviewed commit: "fix(billing): serialize plan switches pe..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 28 files
This PR changes payment, billing, or quota logic. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
…tries, tighter seat-month claim - the plan-switch rebase reads headroom from the limit and credit balance read before Stripe, keeping the exact-floor guard for a retry - a retry that finds Stripe already on the target price records the retrieved item's period - the annual seat-month claim also matches plan, period, seats and interval - only a personal Pro trial blocks a Team upgrade - end-trial refetches on settle, since a lost response can hide a completed charge
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…the Stripe switch A pre-switch snapshot predates any webhook, so a limit in it at the new allowance is headroom the payer chose. A retry that finds Stripe already switched takes no snapshot and keeps the live-limit guard.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
A switch takes the billing reference's checkout admission claim and re-checks that the subscription still holds the plan and interval it computed from, so a concurrent switch cannot snapshot another's new allowance as chosen headroom.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
COMMITleaves later pending files in autocommit, and a lock-timeout retry replays them from the top. They now useIF NOT EXISTSand FKs guarded onpg_constraint.payment_behavior: 'error_if_incomplete', maps a card decline to a payer error, and refuses a trial already cancelled at period end.formatMonthlyPlanPrice, a sharedAVERAGE_MONTH_MS, and the deletion's resolved owner id for the plan-ended emailType of Change
Testing
bun run test:integration):plan-allowance22/22,free-plan13/13,trial27/27,enterprise-self-serve13/13payment_behavior/cancel/decline, trial→Team guard)invoices.test.ts,switch-plan/route.test.ts,subscriptions/utils.test.ts,byok.test.ts,tools/index.test.tsbun run lint,bun run check:migrations origin/staging. Type-check and audits run in CI.Checklist
test-auditauthoring gate)