Repository navigation
fix(billing): trial-aware usage card, personal-only trial credit base, trial_card user_id index - #10358
Merged
Conversation
…, trial_card user_id index - The usage-limit card told a personal trial to increase a limit it cannot edit; it now says usage resumes when the trial ends. Payers carry their subscription status for this. - setUsageLimitForCredits applies the trial allowance only to a personal pool; an organization keeps its seat-priced plan base, as every other org limit path does. - 0472 indexes trial_card(user_id) for the claim lookup and the ON DELETE SET NULL cleanup.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryThis PR makes usage-limit messages aware of personal trials and keeps organization credit grants based on the plan price and seat count.
No actionable issues were found. Tests were inspected but not run. Reviews (1) · Last reviewed commit: "fix(billing): trial-aware usage card, pe..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
No issues found across 9 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
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
This branch was previously deployed
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.
Follow-up to #10330 from the v0.9.66 release review (#10356).
resolveUsageUpgradePayloadnow returns trial copy (usage resumes when the trial ends) for every caller: copilot continuation, cost callback, provider run limit and the mothership billing tool.UsageUpgradePayer.payerSubscriptionnow requiresstatus; every builder already had it except the chat-access check inhost-context.ts, which now passes it.setUsageLimitForCreditsapplies the trial allowance only to a personal pool. An organization keepsbasePrice × seats, matchingsyncSubscriptionUsageLimitsandgetOrgUsageLimit.trial_card(user_id). The claim query (fingerprint = $1 OR user_id = $2) and the FK'sON DELETE SET NULLboth scanned the table, which only grows. It is built CONCURRENTLY after a COMMIT, with replay guards copied from 0467. 0471 is already applied on staging, so the index can't go into 0471.Tests: four new cases in
trial.integration.tsagainst real Postgres. Reverting each guard turns its tests red (3 fail), and the converted-Pro case stays green.