Skip to content

[backport cloud/1.48] fix(billing): resume a pending top-up as a top-up, not a subscription - #14723

Merged
comfy-pr-bot merged 1 commit into
cloud/1.48from
backport-14715-to-cloud-1.48
Aug 4, 2026
Merged

[backport cloud/1.48] fix(billing): resume a pending top-up as a top-up, not a subscription#14723
comfy-pr-bot merged 1 commit into
cloud/1.48from
backport-14715-to-cloud-1.48

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #14715 to cloud/1.48

Automatically created by backport workflow.

…#14715)

## Description

Billing status can return an in-flight billing operation
(`pending_billing_op_id` + `action_url`) so a client that lost its local
reference can resume the payment — a reload, a cleared browser, a
different device. The recovery path in `useWorkspaceBilling` assumed
that operation was always a subscription and passed a hardcoded
`'subscription'`.

That assumption is a latent bug regardless of what the server sends
today: any non-subscription operation surfaced there takes the wrong
branch throughout.

- `isSettingUp` turns true, so `SubscriptionPanelContentWorkspace`
replaces the whole panel with a "setting up your subscription" spinner —
hiding the user's actual plan for as long as the operation is pending
- `topupActionOperation` requires `type === 'topup'`, so the top-up
dialog's own recovery prompt never matches
- `handleSuccess` runs `reconcileSubscriptionSuccess()` instead of
`fetchStatus()` + `fetchBalance()`, so credits just purchased never
appear
- the toast and telemetry describe a subscription checkout

Uses the operation type when the API reports one, falling back to
`'subscription'` when it does not — so this is inert against a server
that never sends the field, and correct the moment one does.

**Status:** the server side does not populate a top-up here yet. This is
the client half, landing first because it is safe in isolation; without
it, a server that starts reporting top-ups would drive the wrong UI.
Treat it as removing a hardcoded assumption, not as shipping a
user-visible fix on its own.

## Checklist

- [x] Test added — `recovers a pending top-up as a top-up, not a
subscription`, confirmed to fail without the fix
- [x] `pnpm test:unit` (72 passed in the touched suite), `pnpm
typecheck`, `pnpm lint`, `pnpm format`

## Follow-up (not in this PR)

`billingOperationStore` gives a top-up 120s to discover an
authentication URL (`TIMEOUT_MS`) while a subscription gets 5min
(`SUBSCRIPTION_ACTION_DISCOVERY_TIMEOUT_MS`). Only bites when the
payment page is slow to appear, so it is kept separate.
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Aug 4, 2026
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) August 4, 2026 23:37
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 4, 2026
@dosubot

dosubot Bot commented Aug 4, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about ComfyUI_frontend Add Dosu to your team

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🎭 Playwright: ✅ 1766 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1745 / ❌ 0 / ⚠️ 1 / ⏭️ 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)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/04/2026, 11:39:13 PM UTC

Links

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.48   #14723   +/-   ##
=============================================
  Coverage              ?   69.31%           
=============================================
  Files                 ?     1662           
  Lines                 ?    85949           
  Branches              ?    24772           
=============================================
  Hits                  ?    59578           
  Misses                ?    26261           
  Partials              ?      110           
Flag Coverage Δ
unit 69.31% <100.00%> (?)

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

Files with missing lines Coverage Δ
src/platform/workspace/api/workspaceApi.ts 85.62% <ø> (ø)
...tform/workspace/composables/useWorkspaceBilling.ts 99.05% <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.

@comfy-pr-bot
comfy-pr-bot merged commit 629ba2b into cloud/1.48 Aug 4, 2026
74 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-14715-to-cloud-1.48 branch August 4, 2026 23:50
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 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants