Skip to content

[backport cloud/1.60] fix(billing): hide auto top-up while billing is paused (#23323) - #23340

Merged
dante01yoon merged 2 commits into
cloud/1.60from
backport-23323-to-cloud-1.60
Nov 13, 2026
Merged

dante01yoon merged 2 commits into
cloud/1.60from
backport-23323-to-cloud-1.60

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Manual backport of #23323 (merged as 4d07c59) to cloud/1.60. The bot's cherry-pick failed with conflicts.

Why

Per DES-1240 and Alex's call in the #23278 review, auto top-up is "not available" while a plan is paused: no Turn on, no Set up. On cloud/1.60, the top-up dialog still offered Set up and the Billing tab card still showed Off · Turn on when auto_top_up_setup is frozen for billing_paused. The Billing tab card also stayed visible for payment_past_due.

Root cause

  • TopUpAutoTopUpCard.vue only treated frozen + payment_past_due as paused.
  • The Billing tab BillingAutoTopUpCard.vue (and its card-viewed event) hid only on state: 'unavailable'.

How (adapted)

  • isAutoTopUpNotAvailable(setup) goes into the existing packages/account-core/src/core/billing/capabilities.ts and is exported from @comfyorg/account-core/billing. True for unavailable, or frozen for payment_past_due / billing_paused. Same rule and body as main.
  • TopUpAutoTopUpCard.vue uses it in its inline canSetUp.
  • src/platform/billing/components/billingTab/BillingAutoTopUpCard.vue hides on it, and so does its card-viewed event.
  • No feature flag: this is a bug fix.

Conflict notes

Main file in #23323 On cloud/1.60 Resolution
account-core/.../billingTab/autoTopUpCard.ts (+ test) missing (1.61 SDK billing tab) dropped; the helper goes into existing capabilities.ts, and its table test into capabilities.test.ts
account-core/.../billing/index.ts export list differs kept cloud/1.60's list; added one export
account-ui/.../BillingAutoTopUpCard.vue (+ test) missing; the 1.60 card is src/platform/billing/components/billingTab/BillingAutoTopUpCard.vue same change applied to the 1.60 card; test ported to its test file
useAutoTopUpCardSection.ts missing; the 1.60 card-viewed call lives in the card itself same change applied in the card
TopUpAutoTopUpCard.vue canSetUpAutoTopUp is not on cloud/1.60 kept the inline canSetUp; replaced its paused check with the helper
TopUpAutoTopUpCard.test.ts applied cleanly unchanged from main
AS IS TO BE
setup frozen, billing_paused Billing tab card shows Off · Turn on; dialog offers Set up card hidden; no Set up offer
setup frozen, payment_past_due card shown; no Set up offer card hidden; no Set up offer
graph LR
  M[#23323 on main] --> C[backport core/1.60]
  M --> L[backport cloud/1.60]
Loading

Test evidence

  • vitest (app): TopUpAutoTopUpCard.test.ts + billingTab/BillingAutoTopUpCard.test.ts: 61 passed.
  • vitest (account-core): capabilities.test.ts: 59 passed, including the new isAutoTopUpNotAvailable table.
  • Red check: with only the two .vue files reverted to cloud/1.60, 3 tests fail (shows the prompt: false while setup is frozen for billing_paused, renders nothing when setup is frozen for billing_paused, renders nothing when setup is frozen for payment_past_due). They pass with the fix.
  • pnpm typecheck, pnpm typecheck:account-core, oxlint + eslint on changed files, and account-core lint: clean.
  • Not checked against a live backend in the paused state.

Same commit as the core/1.60 backport: #23339 (cherry-picked cleanly onto cloud/1.60; the same tests, red check, typecheck and lint were re-run here).

## Summary

Per [DES-1240](https://linear.app/comfyorg/issue/DES-1240) (Not
available row) and Alex's call in the #23278 review thread, auto top-up
is hidden with no Turn on while a plan is paused. Cloud still offered
Turn on for `auto_top_up_setup` frozen with `billing_paused`; Platform
already offered no action.

- **Why:** auto top-up can't charge while billing is paused. It comes
back as it was once the payment goes through.
- **Root cause:** `canSetUpAutoTopUp` only treated `payment_past_due` as
paused. The account-ui card hid only `state: 'unavailable'`.
- **How:** account-core adds `isAutoTopUpNotAvailable(setup)`. It
returns true when setup is `unavailable`, or `frozen` for
`payment_past_due` or `billing_paused`.
- `canSetUpAutoTopUp` uses it, which covers the top-up dialog's Set up
offer and the Add credits suggestion.
- The account-ui `BillingAutoTopUpCard` hides on it, and so does the
card-viewed event.
- `TopUpAutoTopUpCard` reads `canSetUpAutoTopUp` instead of its inline
copy. This is the same swap as #23278, so whichever PR lands second
needs a trivial rebase.
- Server facts: the rule renders the served setup state and reason. It
does not combine them with role, plan or tier.
- The 1.60 code under `legacy160` is unchanged.

| | AS IS | TO BE |
|---|---|---|
| setup frozen, `billing_paused` | card shows Off · Turn on ↗; dialog
offers Set up | card hidden; no Set up offer |
| setup frozen, `payment_past_due` | card shown; no Set up offer | card
hidden; no Set up offer |

```mermaid
graph LR
  A[#23278 platformAutoTopUpPath] -. touches same lines of TopUpAutoTopUpCard .- B[this PR]
```

## Verification

- `vitest`: account-core `autoTopUpCard` and `addCredits` (230 passed);
account-ui `BillingAutoTopUpCard` (19 passed); app `TopUpAutoTopUpCard`,
`useAutoTopUpCardSection`, `useAutoTopUpSetupOffer` (71 passed).
- Mutation check: I dropped `billing_paused` from the rule and re-ran.
The new card case and the new `TopUpAutoTopUpCard` case both failed,
then passed once I restored it.
- Not checked against a live backend in the paused state.

(cherry picked from commit 4d07c59)

# Conflicts:
#	packages/account-core/src/core/billing/billingTab/autoTopUpCard.test.ts
#	packages/account-core/src/core/billing/billingTab/autoTopUpCard.ts
#	packages/account-core/src/core/billing/index.ts
#	packages/account-ui/src/billing/tab/BillingAutoTopUpCard.test.ts
#	packages/account-ui/src/billing/tab/BillingAutoTopUpCard.vue
#	src/platform/billing/composables/useAutoTopUpCardSection.ts
@dante01yoon
dante01yoon requested a review from a team as a code owner November 13, 2026 02:22
@dante01yoon dante01yoon added the backport Backporting a PR onto a release candidate label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords: 2

  • [release]
  • [backport

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 3239 passed, 0 failed

📊 Browser Reports
  • chromium: View Report (✅ 2362 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-2x: View Report (✅ 3 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • cloud: View Report (✅ 841 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • desktop: View Report (✅ 9 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 19 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-safari: View Report (✅ 3 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 11/13/2026, 02:26:41 AM UTC

Links

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

No verdict is available. Open the workflow run to confirm the check was intentionally skipped, or fix the collection failure and re-run it.

Findings and check details

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped.

Full docs: scripts/registry-census/README.md

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

🌾 Fallow: ✅ Passed

Findings and check details

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Full docs: ADR-DEVEX-LINT-0015

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since ab9d3abfb2494e9e80bfab4f225b1d1a22ea9bbb

🏛️ Architecture: ✅ Passed

Findings and check details

Warnings (394)

  • billing path matches no source files: src/platform/billing/composables/activateBillingScope.testUtils.ts. Remove or update it in docs/architecture/domains/records/billing.domain.json.
  • error-handling path matches no source files: src/utils/errorUtil.ts. Remove or update it in docs/architecture/domains/records/error-handling.domain.json.
  • graph-model path matches no source files: src/types/linkTopology.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
  • graph-model path matches no source files: src/types/nodeState.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
  • job-queue path matches no source files: src/platform/remote/comfyui/jobs/**. Remove or update it in docs/architecture/domains/records/job-queue.domain.json.
  • linear-mode path matches no source files: src/utils/appMode.ts. Remove or update it in docs/architecture/domains/records/linear-mode.domain.json.
  • link-connection path matches no source files: src/lib/litegraph/src/infrastructure/LinkConnectorEventMap.ts. Remove or update it in docs/architecture/domains/records/link-connection.domain.json.
  • node-widgets path matches no source files: src/types/widgetState.ts. Remove or update it in docs/architecture/domains/records/node-widgets.domain.json.
  • subgraphs path matches no source files: src/lib/litegraph/src/infrastructure/SubgraphEventMap.ts. Remove or update it in docs/architecture/domains/records/subgraphs.domain.json.
  • vue-node-widgets path matches no source files: src/types/positionConfig.ts. Remove or update it in docs/architecture/domains/records/vue-node-widgets.domain.json.
  • workspace path matches no source files: src/platform/workspace/fixtures/**. Remove or update it in docs/architecture/domains/records/workspace.domain.json.
  • packages/api-client/src/abortSignal.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/abortSignal.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchRouteTemplate.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchWithRetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/fetchWithRetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/retryPolicy.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/retryPolicy.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/statusRetryTelemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/api-client/src/statusRetryTelemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/formatUtil.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/formatUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/geometry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/loadExternalScript.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/networkUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/telemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/telemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/urlSafety.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/shared-frontend-utils/src/urlSafety.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/tailwind-utils/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/TopbarActions.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/searchbox/v2/filterChip.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatClipStrip.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatClipTile.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPanel.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPanel.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/VideoConcatPlaybackBar.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/WidgetVideoConcat.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/WidgetVideoConcat.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/videoConcat/__fixtures__/clipTiles.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/components/widgetHistory/WidgetHistoryButtons.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/graph/menuOption.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionActions.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionActions.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionNotices.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentExtensionNotices.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useAgentSidebarTabs.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useLiveGraphNode.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • src/composables/useLiveGraphNode.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • …and 344 more

Full docs: Frontend domain catalog

Reproduce locally
pnpm architecture:check

@jtydhr88 jtydhr88 assigned dante01yoon and unassigned jtydhr88 Nov 13, 2026
@dante01yoon
dante01yoon enabled auto-merge (squash) November 13, 2026 02:23
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@               Coverage Diff               @@
##           cloud/1.60   #23340       +/-   ##
===============================================
+ Coverage       59.33%   87.55%   +28.22%     
===============================================
  Files            2356     3029      +673     
  Lines          103544   164540    +60996     
  Branches            0    41952    +41952     
===============================================
+ Hits            61434   144067    +82633     
+ Misses          42110    19542    -22568     
- Partials            0      931      +931     
Flag Coverage Δ
billing-web-unit 92.04% <ø> (?)
unit 86.80% <100.00%> (?)

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

Files with missing lines Coverage Δ
...ages/account-core/src/core/billing/capabilities.ts 86.36% <100.00%> (+67.61%) ⬆️
...platform/billing/components/TopUpAutoTopUpCard.vue 95.23% <100.00%> (+95.23%) ⬆️
...ing/components/billingTab/BillingAutoTopUpCard.vue 100.00% <100.00%> (ø)

... and 2674 files with indirect coverage changes

🚀 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.

@github-actions

Copy link
Copy Markdown
Contributor

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Oxfmt formatting

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Nov 13, 2026
@dante01yoon
dante01yoon merged commit 57aa960 into cloud/1.60 Nov 13, 2026
110 checks passed
@dante01yoon
dante01yoon deleted the backport-23323-to-cloud-1.60 branch November 13, 2026 02:41
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants