Skip to content

FRONT-3796 fix(billing): read the auto top-up card from one pending server fact - #22885

Closed
dante01yoon wants to merge 1 commit into
mainfrom
claude/front-3796-auto-top-up-pending-fact
Closed

dante01yoon wants to merge 1 commit into
mainfrom
claude/front-3796-auto-top-up-pending-fact

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Why

Before 1.61, the Billing tab rules move into the shared Billing SDK (FRONT-3795). The SDK must not combine billing facts itself (ADR-0042, docs/adr/API-SERVER-FACTS-0042-server-facts-are-rendered-not-derived.md). This is Billing SDK integration work (item A2 of PR A), not a new feature, and owners and members see no change.

Root cause

deriveAutoTopUpSection in @comfyorg/account-core showed the owner auto top-up card when can_manage_auto_top_up && can_top_up. That is two server facts joined on the client, and the API has no single field that answers "show the card".

How

  • useBillingCapabilities (the provider) holds the interim combination as pendingServerFact('BE-25243', canManageAutoTopUp && canTopUp), exposed as canViewAutoTopUpCard.
  • Core AutoTopUpSectionFacts takes canViewAutoTopUpCard instead of the two capabilities, so core no longer combines facts.
  • When BE-25243 ships the served field, the provider reads it and the wrapper is deleted (A4). The scheduled pending-fact job fails once the ticket closes.
  • Tests:
    • The provider is checked across all four capability combinations and is unaffected by the local member role.
    • Core keeps the card / member block / hidden table, and adds a granted card next to a stale denial.
    • The existing Billing tab tests pass unchanged.

The member block reading (not_workspace_owner inside auto_top_up_enabled) is unchanged, and Wei is confirming it in the thread.

AS IS / TO BE

No visual change is expected. Screenshots of the Billing tab for an owner and a member, before and after, follow.

AS IS TO BE
Owner pending pending
Member pending pending

The Billing SDK combined can_manage_auto_top_up && can_top_up to decide
the owner auto top-up card, which ADR-0042 forbids. The provider now holds
that combination as pendingServerFact('BE-25243', ...) and core reads the
single canViewAutoTopUpCard fact. Behaviour is unchanged.
@dante01yoon
dante01yoon requested a review from a team November 4, 2026 03:22
@dante01yoon dante01yoon self-assigned this Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

📊 Browser Reports
  • chromium: View Report (✅ 2374 / ❌ 0 / ⚠️ 1 / ⏭️ 0)
  • chromium-2x: View Report (✅ 3 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • cloud: View Report (✅ 837 / ❌ 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/04/2026, 03:24:49 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 d44ee4b17e6546bdcdad1c1560dee0123105291f

🏛️ Architecture: ✅ Passed

Findings and check details

Warnings (357)

  • 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/comfyui-api-types/src/generated/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/comfyui-api-types/src/generated/types.gen.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
  • packages/comfyui-api-types/src/index.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.
  • …and 307 more

Full docs: Frontend domain catalog

Reproduce locally
pnpm architecture:check

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

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

@dante01yoon dante01yoon closed this Nov 4, 2026
@dante01yoon
dante01yoon deleted the claude/front-3796-auto-top-up-pending-fact branch November 4, 2026 03:24
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

Superseded by #22887 (branch renamed to the 1.61-billing-sdk/ prefix).

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ng/composables/__mocks__/useBillingCapabilities.ts 0.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main   #22885      +/-   ##
==========================================
- Coverage   87.55%   87.55%   -0.01%     
==========================================
  Files        3038     3038              
  Lines      162587   162590       +3     
  Branches    43391    41372    -2019     
==========================================
- Hits       142358   142351       -7     
- Misses      19341    19351      +10     
  Partials      888      888              
Flag Coverage Δ
billing-web-unit 92.16% <ø> (ø)
e2e 59.32% <50.00%> (-0.03%) ⬇️
unit 86.67% <75.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...-core/src/core/billing/billingTab/autoTopUpCard.ts 72.72% <100.00%> (ø)
...account/components/dialogs/settings/BillingTab.vue 97.67% <ø> (ø)
...form/billing/composables/useBillingCapabilities.ts 96.50% <100.00%> (+0.72%) ⬆️
...ng/composables/__mocks__/useBillingCapabilities.ts 85.45% <0.00%> (-1.59%) ⬇️

... and 8 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 github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants