improvement(billing): treat past_due state correctly#3750
improvement(billing): treat past_due state correctly#3750icecrasher321 merged 4 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds centralized helpers/constants in Written by Cursor Bugbot for commit 6289abf. Configure here. |
Greptile SummaryThis PR fixes a billing state machine bug where
Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stripe Webhook / Status Change] --> B{Subscription Status}
B -->|active| C[ENTITLED + USABLE]
B -->|past_due| D[ENTITLED only]
B -->|canceled / other| E[Neither]
C --> F[Full feature access]
C --> G[Can edit usage limits]
C --> H[Can purchase credits]
D --> I{billingBlocked flag?}
I -->|false| J[Plan preserved, features blocked]
I -->|true| K[Plan preserved, features blocked]
J --> L[Billing portal accessible]
J --> M[No downgrade to free tier]
J --> N[Cannot use team/enterprise features]
J --> O[Cannot purchase credits]
J --> P[Cannot edit usage limits]
K --> L
K --> M
K --> N
K --> O
K --> P
E --> Q[Downgrade to free tier\nsyncUsageLimitsFromSubscription]
style C fill:#22c55e,color:#fff
style D fill:#f59e0b,color:#fff
style E fill:#ef4444,color:#fff
style F fill:#dcfce7
style G fill:#dcfce7
style H fill:#dcfce7
style Q fill:#fee2e2
Reviews (2): Last reviewed commit: "Fix type errors" | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Summary
Past_Due should be treated as someone still on the subscription but blocked. Currently, code path downgrades on status change to this.
Type of Change
Testing
Tested manually
Checklist