Skip to content

fix(frontend): don't show paywall for credits-only orgs#1628

Merged
riderx merged 1 commit into
mainfrom
fix/credits-only-paywall-modal
Feb 13, 2026
Merged

fix(frontend): don't show paywall for credits-only orgs#1628
riderx merged 1 commit into
mainfrom
fix/credits-only-paywall-modal

Conversation

@WcaleNieWolny
Copy link
Copy Markdown
Contributor

@WcaleNieWolny WcaleNieWolny commented Feb 13, 2026

Summary (AI generated)

  • Fixed currentOrganizationFailed check in the organization store to also consider can_use_more flag
  • Two lines changed in src/stores/organization.ts — both places where the paywall state is computed

Motivation (AI generated)

PR #1575 ("Allow credit usage without active plan") updated the backend so get_orgs_v7() returns can_use_more: true when an org has available credits, even without an active Stripe subscription. However, the frontend store still only checks paying and trial_left to decide whether to show the "subscription required" blocking modal. This means credits-only orgs (like with 5 credits, paying: false, trial_left: 0, can_use_more: true) get blocked by the paywall despite having valid credits.

Business Impact (AI generated)

Credits-only / pay-as-you-go users are completely locked out of the dashboard by the paywall modal, even though the backend correctly allows them. This blocks the new use case that #1575 was designed to enable — users who buy credits without subscribing to a plan. Fixing this unblocks revenue from credit-only customers.

Test Plan (AI generated)

  • Spoofed as Upfan org owner (2e08b725-30cf-4098-8a9e-fe48a1c07306) on localhost with production backend
  • Verified the "subscription required" PaymentRequiredModal no longer appears
  • Dashboard loads normally with all charts and data accessible
  • Verify orgs with paying: true still work normally (no regression)
  • Verify orgs with trial_left > 0 still work normally (no regression)
  • Verify orgs with paying: false, trial_left: 0, can_use_more: false still show the paywall

Generated with AI

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where organizations could be incorrectly marked as failed, improving system reliability and reducing false failure states.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

The organization failure detection logic has been expanded to consider an additional flag (can_use_more) alongside existing conditions. The system now marks an organization as trustworthy if it has paid access, remaining trial time, or can use more resources, rather than just the first two conditions.

Changes

Cohort / File(s) Summary
Organization Store Logic
src/stores/organization.ts
Updated organization failure condition to include can_use_more flag alongside paying and trial_left > 0 checks in two watchers. The negated condition now evaluates: !(paying || trial_left > 0 || can_use_more) to determine trust status.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A flag called can_use_more hops in,
Making organizations trust within,
Where logic blooms in watchers twain,
The system's heart beats clear again,
More resources, more to gain! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description includes a Summary, Motivation, Business Impact, and Test Plan, but is missing the Checklist section required by the template. Add the required Checklist section with items for code style, documentation changes, E2E test coverage, and manual testing confirmation.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: preventing the paywall from being shown for organizations that only have credits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/credits-only-paywall-modal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@riderx riderx merged commit 050d588 into main Feb 13, 2026
14 of 16 checks passed
@riderx riderx deleted the fix/credits-only-paywall-modal branch February 13, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants