Skip to content

[backport cloud/1.51] fix(billing): let unsubscribed workspaces add credits on Local - #15829

Merged
comfy-pr-bot merged 1 commit into
cloud/1.51from
backport-15799-to-cloud-1.51
Aug 24, 2026
Merged

comfy-pr-bot merged 1 commit into
cloud/1.51from
backport-15799-to-cloud-1.51

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #15799 to cloud/1.51

Automatically created by backport workflow.

## Summary

An unsubscribed workspace on Local had no way to add credits: the
subscribe CTA is hidden on Local (#15601) but the Add credits button
never appeared, because both entry points were gated on
`canAccessSubscriptionFeatures` (QA finding #11 from the 1.51
workspace-switcher test plan).

## Changes

- **What**: Gate the Add credits button in `CurrentUserPopoverWorkspace`
and `CreditsTile` on the billing policy table (`topUpAccess ===
'allowed'`) instead of `canAccessSubscriptionFeatures`.
`showTopUpCreditsDialog` already enforces this same policy, so the
buttons and the dialog now agree. The popover's free-tier upsell is
likewise driven by `showsSubscribeUpsellUI`, which also stops the
Cloud-only upgrade upsell from rendering on a Local free tier.

- **Team workspaces**: the Plan & Credits panel forced the
never-subscribed team prompt (`Subscribe now` + zero-state tile) on
every distribution, so a never-subscribed team workspace on Local also
had no top-up path. That prompt is now Cloud-only; the ended-team
inactive treatment is unchanged everywhere so billing, invoices, and
reactivation stay reachable.

## Review Focus

- Cloud behavior is unchanged by construction: on Cloud, `topUpAccess
=== 'allowed'` only in states where `canAccessSubscriptionFeatures` is
already true, and `CloudWithoutActiveSubscription`/`CloudAndFree` keep
their previous surfaces (subscribe action / upgrade upsell).
- On Local every policy state allows top-up, so the button now renders
for unsubscribed workspaces; owner permission gating
(`permissions.canTopUp`) is unchanged.
- The bug only reproduces on the workspace billing rail (`billing_rail:
'stripe'`): the legacy rail exempts Local from the subscription gate,
which is why the existing legacy-rail e2e passes on main. This PR adds
`localCreditsWorkspaceRail.spec.ts` (own fixture, no shared-file
changes, so no conflict with #15797) covering the failing rail end to
end.

Needs backport to `core/1.51` after merge — this is a sign-off blocker
for the 1.51 QA round.

## Screenshots

Local build, workspace billing rail, no active subscription (`is_active:
false`), owner.

| Surface | AS IS (main) | TO BE (this PR) |
| --- | --- | --- |
| Profile popover | ![as-is
popover](https://raw.githubusercontent.com/dante01yoon/ComfyUI_frontend/assets/pr-15799-screenshots/as-is-popover.png)
| ![to-be
popover](https://raw.githubusercontent.com/dante01yoon/ComfyUI_frontend/assets/pr-15799-screenshots/to-be-popover.png)
|
| Settings > Plan & Credits | ![as-is
settings](https://raw.githubusercontent.com/dante01yoon/ComfyUI_frontend/assets/pr-15799-screenshots/as-is-settings.png)
| ![to-be
settings](https://raw.githubusercontent.com/dante01yoon/ComfyUI_frontend/assets/pr-15799-screenshots/to-be-settings.png)
|

AS IS: no Add credits button in either surface (and no Subscribe button
on Local) — a dead end. TO BE: Add credits is available and opens the
top-up dialog.
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Aug 24, 2026
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) August 24, 2026 21:13
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/24/2026, 09:15:00 PM UTC

Links

🎭 Playwright: ✅ 1827 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1806 / ❌ 0 / ⚠️ 2 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • New-test walkthrough (chromium, recorded video): View Report

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Aug 24, 2026
@github-actions
github-actions Bot requested a review from thedatalife August 24, 2026 21:13
@comfy-pr-bot
comfy-pr-bot merged commit 64278d7 into cloud/1.51 Aug 24, 2026
84 of 86 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-15799-to-cloud-1.51 branch August 24, 2026 21:27
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.51   #15829   +/-   ##
=============================================
  Coverage              ?   81.58%           
=============================================
  Files                 ?     1884           
  Lines                 ?   117764           
  Branches              ?    36793           
=============================================
  Hits                  ?    96072           
  Misses                ?    21220           
  Partials              ?      472           
Flag Coverage Δ
unit 73.18% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...form/cloud/subscription/components/CreditsTile.vue 98.95% <100.00%> (ø)
...rkspace/components/CurrentUserPopoverWorkspace.vue 88.73% <100.00%> (ø)
...e/components/SubscriptionPanelContentWorkspace.vue 97.14% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@huang47 huang47 added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:xhigh PR risk grade (advisory shadow check; grader-owned) size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants