Skip to content

FE-2479 feat(billing): read the usage log on the SDK rail - #18047

Merged
dante01yoon merged 1 commit into
jaewon/fe-2467-billing-events-reader-in-account-core-exposed-on-the-sdkfrom
jaewon/fe-2479-read-the-usage-logs-billing-events-on-the-sdk-rail
Sep 19, 2026
Merged

dante01yoon merged 1 commit into
jaewon/fe-2467-billing-events-reader-in-account-core-exposed-on-the-sdkfrom
jaewon/fe-2479-read-the-usage-logs-billing-events-on-the-sdk-rail

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The usage log is the last billing read still bound to workspaceApi. PR 2 put the reader in account-core and exposed readEvents on billingSdkStore; nothing calls it. This PR is that call site.

With billing_sdk_topup_enabled or billing_sdk_subscription_enabled on, every other billing surface reads through the SDK and this one table still reaches for the workspace client directly — the one read left off the rail the other five already take.

Root cause

UsageLogsTable.vue branches on shouldUseWorkspaceBilling alone: the workspace client, or customerEventService.getMyEvents for the legacy /customers feed. There is no third arm, because when the readers landed (#17940 / #17942 / #17946) there was no core reader for /billing/events to point one at.

That absence outlived the reader. BillingReadRail — the contract those five reads resolve through — still declares five members, and FE-2467 deliberately stopped at billingSdkStore, leaving the interface widening to whoever brought the caller. So even with the store method in place, the rail type does not expose it: the switch could not be written without this change.

How

readEvents joins BillingReadRail (useBillingReadRail.ts:28). It is the only member taking options, because it is the only read that asks for one page rather than one route per scope.

The workspace arm resolves through the rail (UsageLogsTable.vue:150–:155, called at :168):

const rail = useBillingReadRail()
return rail === null
  ? workspaceApi.getBillingEvents(params)
  : readOnRail(() => rail.readEvents(params))

Two choices inside that:

  • The read is closed over, not passed with its arguments. FE-2479 sketches readOnRail(rail.readEvents, params), but readOnRail takes a zero-arg read and useBillingCapabilities.ts:74 already closes over its options rather than widening the signature. Following the existing pattern keeps readOnRail — used by all five other reads — untouched.
  • The rail is read once per load and held for it, inside readWorkspaceEvents, per the rule on useBillingReadRail: a flag flip mid-read must not start on one client and publish through the other.

The customerEventService branch is untouched. That is the legacy /customers endpoint, out of scope per M1-13, and it keeps its own error surface at :204.

A superseded rail read gets its own early return (:181). readOnRail resolves undefined on SUPERSEDED rather than throwing, and the existing falsy-response branch renders credits.loadEventsError. Without the guard a scope change would reach the customer as "Failed to load activity". undefined identifies exactly one thing here: getMyEvents returns CustomerEventsResponse | null and getBillingEvents throws instead of returning falsy, so only a superseded rail read produces it. Nothing is published and nothing is reported — the same stance useBillingPlans.ts:44 takes on the same result.

The latestLoadToken guard and the isPendingTopupCompleted call keep their order, so a mid-checkout route flip still reports a top-up that landed on the losing fetch.

AS IS / TO BE

Flag off, nothing changes. rail === null resolves to the same workspaceApi.getBillingEvents(params) call the file made before, on the same branch, with the same error handling.

Flag on, the same rows arrive over the SDK transport. The store's readEvents returns BillingEventsResponse, the type this table already consumed, so the rendered page is identical — the rail changes who fetches, not what is shown. A before/after capture would be two identical tables, so none is attached.

The one new behaviour is the superseded case, and it is reachable only on the rail. AS IS, a load that resolves falsy shows "Failed to load activity". TO BE, a rail read whose scope moved on leaves the table as it was and says nothing; a genuine failure still throws and still shows the localized fallback.

Testing

UsageLogsTable.test.ts grows from 22 to 31 tests:

  • A four-row table over shouldUseWorkspaceBilling × rail, asserting which of the three readers serves the page and that the other two are not called. The false × on row is what holds the /customers feed off the rail.
  • The reader's page rendering the way the legacy rail renders its own.
  • The paginator moving to page 2 issuing its own read for page 2 — the reader keys requests by page, so this is the host-side half of what events.test.ts:92 proves in the core.
  • SUPERSEDED publishing nothing and reporting nothing.
  • A failed read surfacing the localized fallback.
  • Top-up completion telemetry running off the reader page.

Each new test was checked against the unpatched component: reverting the production diff fails five of them, and removing only the undefined guard fails the superseded row.

pnpm test:unit src/platform/workspace src/composables/billing src/platform/cloud/subscription (118 files, 2287 tests, 1 expected-fail), pnpm typecheck, pnpm lint and pnpm knip all pass.

Plan position

Milestone 1, Step 1 — PR plan. This is PR 3, the tail of the two-PR usage-log stack. Its base is PR 2's branch, so review that one first.

PR Tickets What Status
1 FE-2469 operation-state projections on the SDK store open — #18036
2 FE-2467 billing events reader in account-core open — #18042
3 FE-2479 usage log reads on the SDK rail this PR
4 FE-2468 payment recovery reads on the rail independent
5 FE-2470 team checkout on the SDK subscribe command independent
6 FE-2471 one status reader for the cloud subscription store independent
7 FE-2480 + FE-2481 stop registering a second poller needs 1
8 FE-2482 subscription panel reads the SDK store needs 1
9 FE-2484 + FE-2483 + FE-2485 recovery through the SDK lifecycle needs 1
10 FE-2474 top-up dialog reads through its adapter independent
11 FE-2481 one proration_at rule backend answer
12 FE-2472 table-driven safety net independent

The plan's open question for this PR is now closed. It flagged that FE-2479 adds a sixth read with no E2E ticket, and offered two ways out: widen FE-2476 to six reads and stack it behind PR 3, or carry the events row here. Nothing under browser_tests/ references billingSdkTopupRailEnabled or billingSdkSubscriptionRailEnabled today, so there is no reader-rail spec to add a row to — carrying it here would mean building the first rail-flag E2E harness inside an adoption PR, duplicating the scaffolding FE-2476 exists to build. FE-2476 was unstarted, so widening cost nothing. Picked: widen FE-2476 to six reads, now retitled and blocked on FE-2479. The cost is that PR 14 loses its independence from Step 1.

flowchart LR
  PR3["PR 3 · FE-2479<br/>usage log on the rail"]:::here
  PR2["PR 2 · FE-2467"] --> PR3
  PR1["PR 1 · FE-2469"] --> PR789["PR 7, 8, 9<br/>needs 1"]
  IND["PR 4, 5, 6, 10, 11, 12<br/>independent"]
  PR3 --> PR14["PR 14 · FE-2476<br/>six-read E2E"]

  PR3 --> BAKE["Step 3 · staging bake"]
  PR789 --> BAKE
  IND --> BAKE
  PR14 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
Loading
  • Part of FE-2479

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1031de38-0a77-4fad-98cd-731c095c75e9

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

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

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/19/2026, 12:59:24 AM UTC

Links

🎭 Playwright: ❌ 2039 passed, 1 failed

❌ Failed Tests

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

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.3 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.4 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.2 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 75.8 MB heap
large-graph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.0 MB heap
large-graph-pan: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 81.0 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.4 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 75.6 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.6 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 73.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.6 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.3 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 167ms TBT · 101.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 80.7 MB heap
vue-large-graph-idle: · 55.4 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 172.3 MB heap
vue-large-graph-pan: · 56.3 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 289ms TBT · 170.7 MB heap
vue-node-resize-workload: · 53.7 avg FPS · 39.9 P5 FPS ❌ (target: ≥52) · 628ms TBT · 158.0 MB heap
vue-zoom-out-idle: · 55.4 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 173.4 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.4 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 9ms
canvas-idle: layout count 0
canvas-idle: style recalc count 8
canvas-idle: task duration 605ms
canvas-idle: script duration 14ms
canvas-idle: TBT 0ms
canvas-idle: heap used 67.3 MB
canvas-idle: DOM nodes -262
canvas-idle: event listeners -152
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 5ms
canvas-mouse-sweep: style recalc duration 41ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 79
canvas-mouse-sweep: task duration 1005ms
canvas-mouse-sweep: script duration 195ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 68.4 MB
canvas-mouse-sweep: DOM nodes -264
canvas-mouse-sweep: event listeners -163
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 21ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 467ms
canvas-zoom-sweep: script duration 18ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 61.2 MB
canvas-zoom-sweep: DOM nodes 75
canvas-zoom-sweep: event listeners 15
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 8ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 10
dom-widget-clipping: task duration 552ms
dom-widget-clipping: script duration 190ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 75.8 MB
dom-widget-clipping: DOM nodes 15
dom-widget-clipping: event listeners 0
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 5ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 3
large-graph-idle: task duration 817ms
large-graph-idle: script duration 49ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 79.0 MB
large-graph-idle: DOM nodes -253
large-graph-idle: event listeners -152
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 13ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 63
large-graph-pan: task duration 2073ms
large-graph-pan: script duration 1060ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 81.0 MB
large-graph-pan: DOM nodes -128
large-graph-pan: event listeners -76
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 17ms
large-graph-zoom: style recalc duration 15ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 62
large-graph-zoom: task duration 1964ms
large-graph-zoom: script duration 962ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 70.4 MB
large-graph-zoom: DOM nodes -259
large-graph-zoom: event listeners -87
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 40
legacy-node-drag: task duration 2289ms
legacy-node-drag: script duration 1178ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 75.6 MB
legacy-node-drag: DOM nodes 0
legacy-node-drag: event listeners 180
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 3ms
minimap-idle: layout count 0
minimap-idle: style recalc count 3
minimap-idle: task duration 787ms
minimap-idle: script duration 48ms
minimap-idle: TBT 0ms
minimap-idle: heap used 79.6 MB
minimap-idle: DOM nodes -257
minimap-idle: event listeners -152
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 12ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 46
subgraph-dom-widget-clipping: task duration 489ms
subgraph-dom-widget-clipping: script duration 164ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 73.4 MB
subgraph-dom-widget-clipping: DOM nodes 17
subgraph-dom-widget-clipping: event listeners 6
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 12ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 658ms
subgraph-idle: script duration 14ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 62.6 MB
subgraph-idle: DOM nodes -279
subgraph-idle: event listeners -198
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 7ms
subgraph-mouse-sweep: style recalc duration 38ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 79
subgraph-mouse-sweep: task duration 1062ms
subgraph-mouse-sweep: script duration 145ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 68.3 MB
subgraph-mouse-sweep: DOM nodes -277
subgraph-mouse-sweep: event listeners -198
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 15ms
subgraph-transition-enter: style recalc duration 33ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 15
subgraph-transition-enter: task duration 1131ms
subgraph-transition-enter: script duration 42ms
subgraph-transition-enter: TBT 167ms
subgraph-transition-enter: heap used 101.4 MB
subgraph-transition-enter: DOM nodes 13587
subgraph-transition-enter: event listeners 2383
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 48ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 245
viewport-pan-sweep: task duration 7421ms
viewport-pan-sweep: script duration 3506ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 80.7 MB
viewport-pan-sweep: DOM nodes -254
viewport-pan-sweep: event listeners -152
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 19815ms
vue-large-graph-idle: script duration 373ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 172.3 MB
vue-large-graph-idle: DOM nodes -8061
vue-large-graph-idle: event listeners -14928
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 34ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 162
vue-large-graph-pan: task duration 22970ms
vue-large-graph-pan: script duration 1177ms
vue-large-graph-pan: TBT 289ms
vue-large-graph-pan: heap used 170.7 MB
vue-large-graph-pan: DOM nodes -8061
vue-large-graph-pan: event listeners -14928
vue-node-resize-workload: avg frame time 19ms
vue-node-resize-workload: p95 frame time 25ms
vue-node-resize-workload: layout duration 31ms
vue-node-resize-workload: style recalc duration 88ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 7241ms
vue-node-resize-workload: script duration 150ms
vue-node-resize-workload: TBT 628ms
vue-node-resize-workload: heap used 158.0 MB
vue-node-resize-workload: DOM nodes -8061
vue-node-resize-workload: event listeners -14928
vue-zoom-out-idle: avg frame time 18ms
vue-zoom-out-idle: p95 frame time 17ms
vue-zoom-out-idle: layout duration 0ms
vue-zoom-out-idle: style recalc duration 0ms
vue-zoom-out-idle: layout count 0
vue-zoom-out-idle: style recalc count 0
vue-zoom-out-idle: task duration 9679ms
vue-zoom-out-idle: script duration 189ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 173.4 MB
vue-zoom-out-idle: DOM nodes 0
vue-zoom-out-idle: event listeners 0
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 28ms
workflow-execution: layout count 4
workflow-execution: style recalc count 12
workflow-execution: task duration 133ms
workflow-execution: script duration 12ms
workflow-execution: TBT 0ms
workflow-execution: heap used 62.4 MB
workflow-execution: DOM nodes 139
workflow-execution: event listeners 49
Raw data
{
  "timestamp": "2026-09-19T01:10:38.457Z",
  "gitSha": "59ab4ee369d52d5e6b04a8d46046f9eec762ced8",
  "branch": "jaewon/fe-2479-read-the-usage-logs-billing-events-on-the-sdk-rail",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2038.2669999999052,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 9.287,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 617.7280000000001,
      "heapDeltaBytes": 5951700,
      "heapUsedBytes": 67926276,
      "domNodes": -260,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 14.722999999999997,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2042.3449999999548,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 8.861999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 592.3989999999999,
      "heapDeltaBytes": 12361924,
      "heapUsedBytes": 73239520,
      "domNodes": -263,
      "jsHeapTotalBytes": 4186112,
      "scriptDurationMs": 13.085000000000003,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1990.6929999999647,
      "styleRecalcs": 80,
      "styleRecalcDurationMs": 44.04900000000001,
      "layouts": 14,
      "layoutDurationMs": 5.476,
      "taskDurationMs": 1059.1870000000001,
      "heapDeltaBytes": 19156312,
      "heapUsedBytes": 79863240,
      "domNodes": -264,
      "jsHeapTotalBytes": 6807552,
      "scriptDurationMs": 194,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1936.884999999961,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 38.491,
      "layouts": 14,
      "layoutDurationMs": 5.373,
      "taskDurationMs": 950.6780000000001,
      "heapDeltaBytes": 1761032,
      "heapUsedBytes": 63643948,
      "domNodes": -264,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 195.96099999999998,
      "eventListeners": -174,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1729.5670000000882,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 22.091,
      "layouts": 6,
      "layoutDurationMs": 1.546,
      "taskDurationMs": 473.009,
      "heapDeltaBytes": 2080224,
      "heapUsedBytes": 64051148,
      "domNodes": 75,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 17.548,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1735.1320000000214,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 20.397,
      "layouts": 6,
      "layoutDurationMs": 1.325,
      "taskDurationMs": 461.056,
      "heapDeltaBytes": 2180180,
      "heapUsedBytes": 64277696,
      "domNodes": 74,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 17.968999999999994,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 861.9609999999511,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.563,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 582.4,
      "heapDeltaBytes": 18141948,
      "heapUsedBytes": 79371636,
      "domNodes": 12,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 197.03300000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 750.8139999999912,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 10.282,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 522.27,
      "heapDeltaBytes": 17555844,
      "heapUsedBytes": 79563884,
      "domNodes": 18,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 183.277,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2082.6840000000857,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 5.372999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 814.3800000000001,
      "heapDeltaBytes": 2833204,
      "heapUsedBytes": 82751128,
      "domNodes": -253,
      "jsHeapTotalBytes": -270336,
      "scriptDurationMs": 45.443999999999996,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2068.7789999999495,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 4.425999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 819.164,
      "heapDeltaBytes": 2685788,
      "heapUsedBytes": 82825936,
      "domNodes": -253,
      "jsHeapTotalBytes": -794624,
      "scriptDurationMs": 53.473000000000006,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 3240.7670000000053,
      "styleRecalcs": 64,
      "styleRecalcDurationMs": 15.459999999999997,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2084.377,
      "heapDeltaBytes": 19566636,
      "heapUsedBytes": 83522540,
      "domNodes": -256,
      "jsHeapTotalBytes": 1798144,
      "scriptDurationMs": 1072.301,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 3240.2340000001004,
      "styleRecalcs": 62,
      "styleRecalcDurationMs": 11.383999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2061.2599999999998,
      "heapDeltaBytes": 22356364,
      "heapUsedBytes": 86370928,
      "domNodes": 0,
      "jsHeapTotalBytes": 225280,
      "scriptDurationMs": 1047.3490000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 4036.8419999999787,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 13.412,
      "layouts": 60,
      "layoutDurationMs": 17.644,
      "taskDurationMs": 1979.4699999999998,
      "heapDeltaBytes": 8795032,
      "heapUsedBytes": 74219328,
      "domNodes": -261,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 982.291,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 4028.9960000000065,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 17.174,
      "layouts": 60,
      "layoutDurationMs": 16.697,
      "taskDurationMs": 1949.025,
      "heapDeltaBytes": -7458544,
      "heapUsedBytes": 73494216,
      "domNodes": -257,
      "jsHeapTotalBytes": 778240,
      "scriptDurationMs": 941.584,
      "eventListeners": -174,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3291.529999999966,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 6.222999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2192.273,
      "heapDeltaBytes": 25299828,
      "heapUsedBytes": 90811052,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 1112.479,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3587.861000000089,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 6.185000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2386.493,
      "heapDeltaBytes": 1873112,
      "heapUsedBytes": 67784780,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 1242.586,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2053.1009999999696,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 3.8310000000000013,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 832.3960000000001,
      "heapDeltaBytes": -4559016,
      "heapUsedBytes": 83013124,
      "domNodes": -256,
      "jsHeapTotalBytes": -495616,
      "scriptDurationMs": 50.257999999999996,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2032.0970000000216,
      "styleRecalcs": 2,
      "styleRecalcDurationMs": 2.553,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 740.791,
      "heapDeltaBytes": 20114764,
      "heapUsedBytes": 83959544,
      "domNodes": -257,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 45.272000000000006,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 682.7660000000151,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 11.64,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 470.9390000000001,
      "heapDeltaBytes": 13740184,
      "heapUsedBytes": 76920404,
      "domNodes": 18,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 158.043,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 706.8009999999276,
      "styleRecalcs": 45,
      "styleRecalcDurationMs": 11.75,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 508.031,
      "heapDeltaBytes": 13710756,
      "heapUsedBytes": 77057568,
      "domNodes": 16,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 170.55499999999998,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2040.2049999999008,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 11.386999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 714.833,
      "heapDeltaBytes": 12133656,
      "heapUsedBytes": 75361648,
      "domNodes": -277,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 15.645000000000003,
      "eventListeners": -198,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2037.1360000000323,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 12.567000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 601.5029999999999,
      "heapDeltaBytes": -6829484,
      "heapUsedBytes": 55885844,
      "domNodes": -280,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 13.247000000000002,
      "eventListeners": -198,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1862.551999999937,
      "styleRecalcs": 79,
      "styleRecalcDurationMs": 37.769999999999996,
      "layouts": 18,
      "layoutDurationMs": 7.613999999999999,
      "taskDurationMs": 1094.359,
      "heapDeltaBytes": 11023496,
      "heapUsedBytes": 73172716,
      "domNodes": -279,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 145.39200000000002,
      "eventListeners": -198,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1856.2479999999368,
      "styleRecalcs": 79,
      "styleRecalcDurationMs": 37.943999999999996,
      "layouts": 18,
      "layoutDurationMs": 6.534000000000001,
      "taskDurationMs": 1030.095,
      "heapDeltaBytes": 6814288,
      "heapUsedBytes": 70111260,
      "domNodes": -275,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 144.483,
      "eventListeners": -198,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1451.3699999999972,
      "styleRecalcs": 15,
      "styleRecalcDurationMs": 33.249,
      "layouts": 5,
      "layoutDurationMs": 14.660000000000004,
      "taskDurationMs": 1130.546,
      "heapDeltaBytes": 19174212,
      "heapUsedBytes": 106328668,
      "domNodes": 13587,
      "jsHeapTotalBytes": 10747904,
      "scriptDurationMs": 41.74999999999999,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 167,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 11469.309000000067,
      "styleRecalcs": 246,
      "styleRecalcDurationMs": 47.66100000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7389.251999999999,
      "heapDeltaBytes": 4725728,
      "heapUsedBytes": 83572948,
      "domNodes": -252,
      "jsHeapTotalBytes": -77824,
      "scriptDurationMs": 3454.637,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 11773.758999999927,
      "styleRecalcs": 244,
      "styleRecalcDurationMs": 48.401,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7453.342000000001,
      "heapDeltaBytes": 6301644,
      "heapUsedBytes": 85683336,
      "domNodes": -256,
      "jsHeapTotalBytes": 1757184,
      "scriptDurationMs": 3558.083,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 20016.44299999998,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 19904.524999999998,
      "heapDeltaBytes": -41666312,
      "heapUsedBytes": 183312480,
      "domNodes": -8061,
      "jsHeapTotalBytes": -16957440,
      "scriptDurationMs": 370.285,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 19934.34500000001,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 19725.623,
      "heapDeltaBytes": -42284172,
      "heapUsedBytes": 177960280,
      "domNodes": -8061,
      "jsHeapTotalBytes": -10321920,
      "scriptDurationMs": 375.892,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 18.330000000000048,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20578.105999999934,
      "styleRecalcs": 142,
      "styleRecalcDurationMs": 28.553999999999967,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20532.892,
      "heapDeltaBytes": -53295052,
      "heapUsedBytes": 177274172,
      "domNodes": -8061,
      "jsHeapTotalBytes": -12378112,
      "scriptDurationMs": 1163.029,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 115,
      "frameDurationMs": 17.219999999999953,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 25472.768000000087,
      "styleRecalcs": 182,
      "styleRecalcDurationMs": 38.59200000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 25407.378999999997,
      "heapDeltaBytes": -49772532,
      "heapUsedBytes": 180700088,
      "domNodes": -8061,
      "jsHeapTotalBytes": -11067392,
      "scriptDurationMs": 1191.469,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 463,
      "frameDurationMs": 18.333333333333332,
      "p95FrameDurationMs": 16.799999999995634
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 7338.853999999969,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 86.44200000000002,
      "layouts": 20,
      "layoutDurationMs": 30.49099999999999,
      "taskDurationMs": 7301.881,
      "heapDeltaBytes": -57298804,
      "heapUsedBytes": 165681508,
      "domNodes": -8061,
      "jsHeapTotalBytes": -286720,
      "scriptDurationMs": 151.559,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 598,
      "frameDurationMs": 18.890000000000025,
      "p95FrameDurationMs": 33.400000000001455
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 7232.193999999936,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 89.13799999999999,
      "layouts": 20,
      "layoutDurationMs": 30.99800000000001,
      "taskDurationMs": 7180.134999999999,
      "heapDeltaBytes": -64984488,
      "heapUsedBytes": 165686580,
      "domNodes": -8061,
      "jsHeapTotalBytes": 6758400,
      "scriptDurationMs": 148.609,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 658,
      "frameDurationMs": 18.33666666666662,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 9891.240000000038,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 9816.824999999997,
      "heapDeltaBytes": 19768492,
      "heapUsedBytes": 194724484,
      "domNodes": 0,
      "jsHeapTotalBytes": -7602176,
      "scriptDurationMs": 203.44099999999997,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 9593.949000000066,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 9541.796999999999,
      "heapDeltaBytes": -11915636,
      "heapUsedBytes": 168931312,
      "domNodes": 0,
      "jsHeapTotalBytes": -13107200,
      "scriptDurationMs": 175.46099999999998,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 18.330000000000048,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 136.066000000028,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 22.242,
      "layouts": 3,
      "layoutDurationMs": 1.818,
      "taskDurationMs": 112.38299999999998,
      "heapDeltaBytes": 3132180,
      "heapUsedBytes": 64256576,
      "domNodes": 131,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 10.632000000000001,
      "eventListeners": 17,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 490.4509999998936,
      "styleRecalcs": 15,
      "styleRecalcDurationMs": 33.242999999999995,
      "layouts": 4,
      "layoutDurationMs": 2.552,
      "taskDurationMs": 154.18200000000002,
      "heapDeltaBytes": 4998596,
      "heapUsedBytes": 66521472,
      "domNodes": 146,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 13.661000000000001,
      "eventListeners": 81,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 51405 78147 65.8% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.8% 1155
src/LGraphNode.ts 70.4% 382
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.5% 344
src/renderer/extensions/layerEditor/composables/useLayerEditorSession.ts 40.1% 332
src/platform/workspace/stores/billingOperationStore.ts 7.9% 316
src/LGraph.ts 79.3% 261
src/platform/workspace/stores/teamWorkspaceStore.ts 38.9% 256
src/scripts/app.ts 72.2% 255
src/core/billing/operationLifecycle.ts 0.9% 232
src/scripts/pnginfo.ts 21.4% 221

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                                             Coverage Diff                                             @@
##           jaewon/fe-2467-billing-events-reader-in-account-core-exposed-on-the-sdk   #18047      +/-   ##
===========================================================================================================
+ Coverage                                                                    82.77%   83.79%   +1.02%     
===========================================================================================================
  Files                                                                         2937     2243     -694     
  Lines                                                                       144467   127624   -16843     
  Branches                                                                     39010    34331    -4679     
===========================================================================================================
- Hits                                                                        119578   106946   -12632     
+ Misses                                                                       23632    20388    -3244     
+ Partials                                                                      1257      290     -967     
Flag Coverage Δ
billing-web-unit ?
e2e 65.78% <ø> (-0.03%) ⬇️
unit 79.13% <100.00%> (-0.01%) ⬇️
website-unit ?

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

Files with missing lines Coverage Δ
...mponents/dialog/content/setting/UsageLogsTable.vue 96.66% <100.00%> (+2.61%) ⬆️
...atform/workspace/composables/useBillingReadRail.ts 100.00% <ø> (ø)

... and 702 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.

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. This is the consumer #18042 promised, and it arriving is the thing we said we would hold that PR to — an additive reader whose call site never appears is dead code, and this is the call site.

It also retroactively settles the argument we made on #18042. We adjudicated CodeRabbit's "track pending reads by scope and resolved route" against the single-slot design, on the grounds that this table reads one page at a time, so the displaced-read cost was bounded. Two things here make that stronger than we could show at the time:

  • getSnapshot is referenced zero times in this file. The consumer takes the promise return, so the shared snapshot a displaced read publishes has no reader at all. The cost we described as "bounded and visible" turns out to be "nobody looks at it."
  • The out-of-order case is handled independently anyway. loadEvents takes const loadToken = ++latestLoadToken and drops the response with if (loadToken !== latestLoadToken) return, so a page-2 answer arriving after page-3 never publishes. That guard is pre-existing on the parent branch (five references), not something this PR added, which is why the rail arm could be dropped in without touching it.

The telemetry ordering is deliberate and correct, and we would have flagged it if the comment were not there. The pending-top-up check runs before the token guard:

Completion telemetry must run even when a mid-checkout route flip supersedes this load, since legacy and workspace backends emit different top-up events and the winning fetch may not carry the completion yet.

That is the right split — publishing is guarded, observing is not, because a superseded load may be the only fetch that ever saw the completion. Dropping it with the response would lose a top-up success event.

The rail arm matches the five that came before it. useBillingReadRail() is called inside readWorkspaceEvents, so the rail is resolved per read and held for it, the same shape as fetchStatus/fetchBalance in #17940. readOnRail handles the SUPERSEDED case and the call site treats undefined as nothing-to-publish, with a comment saying so. The BillingReadRail docstring was updated to name the history feed rather than left describing five reads while declaring six — small, and the kind of thing that usually rots.

readEvents is correctly the only member of the contract documented as varying per call.


One note, not a finding: this is MERGEABLE against jaewon/fe-2467-…, not main, and #18042 is currently CONFLICTING. So this cannot land until that rebases, and its own green status is against the parent rather than the target. Flagging only because a MERGEABLE badge on a stacked PR has misread twice in this wave — #17943 and #17947 both merged into their parents rather than main.

CI clean on this head. Approved.

@dante01yoon
dante01yoon force-pushed the jaewon/fe-2467-billing-events-reader-in-account-core-exposed-on-the-sdk branch from eabcabf to c2470ef Compare September 18, 2026 22:29
@dante01yoon
dante01yoon requested a review from a team as a code owner September 18, 2026 22:29
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

This went CONFLICTING because I rebased its base branch, not because anything here is wrong. #18042 needed a rebase once #18036 merged, and that force-push rewrote the three FE-2467 commits this branch sits on. Git now sees the same content twice under different SHAs — which is also why GitHub reports 3 commits on this PR instead of the 1 that is actually yours.

No content conflict. This branch touches UsageLogsTable.vue, UsageLogsTable.test.ts and useBillingReadRail.ts; the 18042 rebase only resolved an append/append clash in billingSdkStore.test.ts. I verified it rather than assuming — git rebase --onto c2470ef7a eabcabfe5 on a throwaway branch replays this PR's single commit clean, no conflicts, leaving exactly FE-2479 feat(billing): read the usage log on the SDK rail on top of the new base.

Deliberately not rebasing yet. #18042 merges through the queue as a squash, so the moment it lands this branch needs git rebase --onto main <old-base> regardless. Rebasing now would mean two rebases and two dismissals of @christian-byrne's approval, to reach a state that still cannot merge — this PR is stacked, so it cannot go before its parent either way. Waiting costs one rebase and one dismissal, and nothing is blocked in the meantime.

Parent status: 18042 is MERGEABLE, CI green (55 pass / 0 fail), waiting only on a human approval — the ruleset requires one and every push clears it.

@christian-byrne on your note in 18042: the rebase you asked for is done. Your point about the consumer is a stronger version of the argument than the one I made — I reasoned from pagination.page holding one page, but getSnapshot being referenced zero times here means the displaced read's published snapshot has no reader at all, and the pre-existing latestLoadToken guard already dropped out-of-order answers. The single slot costs this consumer nothing rather than little.

The usage log was the last billing read still bound to `workspaceApi`:
`UsageLogsTable` chose between the workspace client and the legacy
`/customers` feed with no SDK branch, so the events reader FE-2467 put on
`billingSdkStore` had no caller.

The workspace arm now resolves through `useBillingReadRail()`, the same
switch the other five reads take, and `readEvents` joins the
`BillingReadRail` contract. The legacy `/customers` branch is untouched —
that is a different endpoint, out of scope here.

A superseded rail read returns undefined rather than throwing, so it gets
its own early return: the scope moved on under the read and the page it
would have published belongs to an actor this host has left. Without it a
scope change would surface as "Failed to load activity". The
`latestLoadToken` guard and the completion-telemetry call keep their order,
so a mid-checkout route flip still reports a top-up that landed on the
losing fetch.
@dante01yoon
dante01yoon force-pushed the jaewon/fe-2479-read-the-usage-logs-billing-events-on-the-sdk-rail branch from 33826ac to d7f9961 Compare September 19, 2026 00:57
@dante01yoon
dante01yoon merged commit 6fc092d into jaewon/fe-2467-billing-events-reader-in-account-core-exposed-on-the-sdk Sep 19, 2026
125 of 127 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-2479-read-the-usage-logs-billing-events-on-the-sdk-rail branch September 19, 2026 11:53
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 19, 2026
…mfy-Org#18136)

## Why

`teamSubscriptionCheckoutUtil.ts:66` calls `workspaceApi.subscribe(...)`
with no rail branch, so a team checkout from the marketing deep link
`/cloud/subscribe?tier=team` always rides the legacy transport — even
with `billing_sdk_subscription_enabled` on and every other subscribe
going through the SDK.

That leaves one entry point issuing a charge on a transport the
milestone is retiring, and it is the entry point a customer arrives on
from outside the app, where nothing else about the session is warm.

## Root cause

This util predates the rail and was never a call site the rail work
looked at: it lives under `platform/cloud/subscription/utils`, not under
`platform/workspace`, and it is a plain function rather than a
composable — so it was not reached by either the `useWorkspaceBilling`
adapter change or the checkout one. The SDK command has accepted
`teamCreditStopId` since `subscriptionCommands.ts:156`; nothing was
missing but the branch.

## How

**`issueTeamSubscribe(planSlug, options)`** takes
`useSubscriptionRail()` and falls through to `workspaceApi.subscribe`
exactly as `useWorkspaceBilling.subscribe` does — `ok` returns the
settled response, `error` throws, and `unavailable` runs the legacy
call, which is the 404 latch every other rail call site uses for a
backend gate that is still closed.

It is a local function rather than a call into `useWorkspaceBilling`,
because that composable is marked `@internal` and builds fresh reactive
state per call: invoking it from a plain util would create an orphaned
`isLoading`/`error` pair that nothing renders.

**`subscribeInputFrom` moves to
`platform/workspace/billing/subscribeInput.ts`** and is imported by both
call sites. It was private to `useWorkspaceBilling`; duplicating a
request-body mapping into a second issuer is how the two drift, and this
mapping carries the two fields that must be dropped rather than sent
empty.

**Everything the util owns is preserved.** A `needs_payment_method`
response without `payment_method_url` still throws rather than stranding
the customer mid-payment — reachable only on the legacy path, since the
rail settles before returning. `trackWorkspaceCheckoutStarted` still
receives the `billingOpId` from whichever rail answered. Telemetry names
and shapes are unchanged, including the `subscription_checkout` failure
event the outer wrapper emits.

## AS IS / TO BE

| | AS IS | TO BE |
| --- | --- | --- |
| Flag off | legacy `POST /api/billing/subscribe` | unchanged |
| Flag on | legacy `POST /api/billing/subscribe` | SDK transport, with
an idempotency key |
| Flag on, route 404 | n/a | SDK attempt, then the legacy call |

No capture is attached: there is no visual difference between the two
rails here — the same Stripe page opens or the same landing happens, and
what changed is which transport issued the charge. The assertions below
are on the request, which is what separates them.

## Testing

- `teamSubscriptionCheckoutUtil.test.ts` — three rail rows beside the
existing legacy ones: the generated body issued through the SDK with the
plan slug, stop id and both URLs, landing back in the app and reporting
the settled operation id to `trackBeginCheckout`; the 404 case running
the legacy call with the options it always sent; and a rail refusal
surfacing as the checkout failure without a legacy retry, since a
declined card is an answer rather than a closed gate.

`pnpm test:unit src/platform/cloud src/platform/workspace
src/composables/billing` (145 files, 2599 tests), `pnpm typecheck`,
`pnpm lint` and `pnpm knip` pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 5**, independent of every other PR in the step.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| **5** | **FE-2470** | **team checkout on the SDK subscribe command** |
**this PR** |
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| 7 | FE-2480 + FE-2481 | checkout reads its operation off the rail |
open — Comfy-Org#18134 |
| 8 | FE-2482 | subscription panel reads the SDK store | open — Comfy-Org#18133 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
open — Comfy-Org#18135 |
| 10 | FE-2474 | top-up dialog reads through its adapter | open — Comfy-Org#18132
|
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR5["PR 5 · FE-2470<br/>team checkout on the rail"]:::here
  PR1["PR 1 · FE-2469<br/>merged"] --> PR789["PR 7, 8, 9"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 6, 10, 11, 12<br/>independent"]

  PR5 --> BAKE["Step 3 · staging bake"]
  PR789 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2470

---------

Co-authored-by: GitHub Action <action@github.com>
dante01yoon added a commit that referenced this pull request Sep 19, 2026
## Why

The usage log is the last billing read still bound to `workspaceApi`. PR
2 put the reader in `account-core` and exposed `readEvents` on
`billingSdkStore`; nothing calls it. This PR is that call site.

With `billing_sdk_topup_enabled` or `billing_sdk_subscription_enabled`
on, every other billing surface reads through the SDK and this one table
still reaches for the workspace client directly — the one read left off
the rail the other five already take.

## Root cause

`UsageLogsTable.vue` branches on `shouldUseWorkspaceBilling` alone: the
workspace client, or `customerEventService.getMyEvents` for the legacy
`/customers` feed. There is no third arm, because when the readers
landed (#17940 / #17942 / #17946) there was no core reader for
`/billing/events` to point one at.

That absence outlived the reader. `BillingReadRail` — the contract those
five reads resolve through — still declares five members, and FE-2467
deliberately stopped at `billingSdkStore`, leaving the interface
widening to whoever brought the caller. So even with the store method in
place, the rail type does not expose it: the switch could not be written
without this change.

## How

**`readEvents` joins `BillingReadRail`** (`useBillingReadRail.ts:28`).
It is the only member taking options, because it is the only read that
asks for one page rather than one route per scope.

**The workspace arm resolves through the rail**
(`UsageLogsTable.vue:150`–`:155`, called at `:168`):

```ts
const rail = useBillingReadRail()
return rail === null
  ? workspaceApi.getBillingEvents(params)
  : readOnRail(() => rail.readEvents(params))
```

Two choices inside that:

- **The read is closed over, not passed with its arguments.** FE-2479
sketches `readOnRail(rail.readEvents, params)`, but `readOnRail` takes a
zero-arg read and `useBillingCapabilities.ts:74` already closes over its
options rather than widening the signature. Following the existing
pattern keeps `readOnRail` — used by all five other reads — untouched.
- **The rail is read once per load and held for it**, inside
`readWorkspaceEvents`, per the rule on `useBillingReadRail`: a flag flip
mid-read must not start on one client and publish through the other.

**The `customerEventService` branch is untouched.** That is the legacy
`/customers` endpoint, out of scope per M1-13, and it keeps its own
error surface at `:204`.

**A superseded rail read gets its own early return** (`:181`).
`readOnRail` resolves `undefined` on `SUPERSEDED` rather than throwing,
and the existing falsy-response branch renders
`credits.loadEventsError`. Without the guard a scope change would reach
the customer as "Failed to load activity". `undefined` identifies
exactly one thing here: `getMyEvents` returns `CustomerEventsResponse |
null` and `getBillingEvents` throws instead of returning falsy, so only
a superseded rail read produces it. Nothing is published and nothing is
reported — the same stance `useBillingPlans.ts:44` takes on the same
result.

The `latestLoadToken` guard and the `isPendingTopupCompleted` call keep
their order, so a mid-checkout route flip still reports a top-up that
landed on the losing fetch.

## AS IS / TO BE

**Flag off, nothing changes.** `rail === null` resolves to the same
`workspaceApi.getBillingEvents(params)` call the file made before, on
the same branch, with the same error handling.

**Flag on, the same rows arrive over the SDK transport.** The store's
`readEvents` returns `BillingEventsResponse`, the type this table
already consumed, so the rendered page is identical — the rail changes
who fetches, not what is shown. A before/after capture would be two
identical tables, so none is attached.

The one new behaviour is the superseded case, and it is reachable only
on the rail. AS IS, a load that resolves falsy shows "Failed to load
activity". TO BE, a rail read whose scope moved on leaves the table as
it was and says nothing; a genuine failure still throws and still shows
the localized fallback.

## Testing

`UsageLogsTable.test.ts` grows from 22 to 31 tests:

- A four-row table over `shouldUseWorkspaceBilling × rail`, asserting
which of the three readers serves the page and that the other two are
not called. The `false × on` row is what holds the `/customers` feed off
the rail.
- The reader's page rendering the way the legacy rail renders its own.
- The paginator moving to page 2 issuing its own read for page 2 — the
reader keys requests by page, so this is the host-side half of what
`events.test.ts:92` proves in the core.
- `SUPERSEDED` publishing nothing and reporting nothing.
- A failed read surfacing the localized fallback.
- Top-up completion telemetry running off the reader page.

Each new test was checked against the unpatched component: reverting the
production diff fails five of them, and removing only the `undefined`
guard fails the superseded row.

`pnpm test:unit src/platform/workspace src/composables/billing
src/platform/cloud/subscription` (118 files, 2287 tests, 1
expected-fail), `pnpm typecheck`, `pnpm lint` and `pnpm knip` all pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 3**, the tail of the two-PR usage-log stack. Its base is PR
2's branch, so review that one first.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | open —
#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — #18042
|
| **3** | **FE-2479** | **usage log reads on the SDK rail** | **this
PR** |
| 4 | FE-2468 | payment recovery reads on the rail | independent |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| 6 | FE-2471 | one status reader for the cloud subscription store |
independent |
| 7 | FE-2480 + FE-2481 | stop registering a second poller | needs 1 |
| 8 | FE-2482 | subscription panel reads the SDK store | needs 1 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
needs 1 |
| 10 | FE-2474 | top-up dialog reads through its adapter | independent |
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

**The plan's open question for this PR is now closed.** It flagged that
FE-2479 adds a sixth read with no E2E ticket, and offered two ways out:
widen FE-2476 to six reads and stack it behind PR 3, or carry the events
row here. Nothing under `browser_tests/` references
`billingSdkTopupRailEnabled` or `billingSdkSubscriptionRailEnabled`
today, so there is no reader-rail spec to add a row to — carrying it
here would mean building the first rail-flag E2E harness inside an
adoption PR, duplicating the scaffolding FE-2476 exists to build.
FE-2476 was unstarted, so widening cost nothing. **Picked: widen FE-2476
to six reads**, now retitled and blocked on FE-2479. The cost is that PR
14 loses its independence from Step 1.

```mermaid
flowchart LR
  PR3["PR 3 · FE-2479<br/>usage log on the rail"]:::here
  PR2["PR 2 · FE-2467"] --> PR3
  PR1["PR 1 · FE-2469"] --> PR789["PR 7, 8, 9<br/>needs 1"]
  IND["PR 4, 5, 6, 10, 11, 12<br/>independent"]
  PR3 --> PR14["PR 14 · FE-2476<br/>six-read E2E"]

  PR3 --> BAKE["Step 3 · staging bake"]
  PR789 --> BAKE
  IND --> BAKE
  PR14 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2479
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 20, 2026
…owns it (Comfy-Org#18134)

## Why

`useSubscriptionCheckout` decides what the checkout dialog shows about
the operation in flight by reading `billingOperationStore` at
`:197`–`:199`, with no rail branch. Six things hang off that one read:
the parked-checkout recovery prompt, the authentication state, the
declined-attempt message, the reconciliation prompt, the busy state that
keeps the pay button locked, and the hosted-step URL.

With `billing_sdk_subscription_enabled` on, the operation is owned by
the SDK lifecycle and the legacy store has no record of it. So the
dialog's answer to all six is "there is no operation" — the pay button
unlocks mid-checkout, a parked checkout offers no way to supply a card,
and a declined attempt shows no reason.

`activeCheckoutActionUrl` is the one that was already patched: `:209`
falls back to `subscriptionRail?.subscriptionActionUrl`. That fallback
is the shape of the fix; this PR gives the other five the same thing
properly.

## Root cause

`billingOperationStore` was the poller *and* the view-model. Comfy-Org#17853 and
Comfy-Org#17665 railed the commands, so a subscribe already issues through the
SDK — but the projections the checkout reads had no counterpart on the
SDK store, so the reads could not follow the writes. FE-2469 (Comfy-Org#18036)
added them; this is the switch.

## How

**`SubscriptionRail` gains the two operation reads**
(`subscriptionOperationView.ts`) — `subscriptionActionOperation` and
`getOperation(opId)` — next to `subscriptionActionUrl`, which was
already a read on that interface. `useSubscriptionRail()` then answers
everything the checkout needs from one place, rather than the checkout
holding a command rail and a second reader.

**`useSubscriptionCheckout` reads `subscriptionRail ??
billingOperationStore`,** captured once at setup for the same reason the
rail itself is: a flip mid-checkout must not have the dialog observe on
a rail the operation was not issued on. The workspace comparison at
`:203` stays where it is — both sides hand back an unscoped record on
purpose.

**`projectOperationRecord` gains `errorMessage`**
(`operationRecordView.ts`), projected from a `failed_retryable`
attempt's decline reason through the same `declineDetail` the top-up
projection uses. Without it `authenticationError` reads `undefined` on
the rail, which is the declined-card message going missing.

### The write half is deliberately unchanged, and that is a correction
to both tickets

FE-2480 asks to "skip `startOperation` when the rail is on" at `:1542` /
`:1548`, and FE-2481 asks the same of `useDowngradeToPersonal.ts:335` /
`:355`. **Implementing that would strand a customer.**

Those four registrations sit behind `response.status ===
'needs_payment_method'` or `'pending_payment'`. The rail's own subscribe
settles before it returns — `projectSubscribeResult` maps a settled
command to `status: 'subscribed'` and everything else to an error — so
those two statuses are shapes only `workspaceApi.subscribe` produces.
And `workspaceApi.subscribe` still runs with the flag on:
`useWorkspaceBilling.ts:445` falls through to it when the SDK route
answers 404, which is the whole point of the `NOT_AVAILABLE` latch.

So the flag is the wrong predicate. On the 404 fallback it is on while
the response came off the legacy transport, and skipping the
registration would leave that operation with no poller at all — the
customer opens the hosted page and nothing ever settles it. There is no
double-poll to remove here: the adapter shape Comfy-Org#17665 chose already
prevents it, which FE-2480's own description says.

The invariant is now pinned by test at both call sites instead, so a
later change cannot reintroduce the second registration the tickets were
guarding against.

## AS IS / TO BE

With `billing_sdk_subscription_enabled` on and a subscribe parked on the
customer:

| | AS IS | TO BE |
| --- | --- | --- |
| Pay button during the operation | unlocks — `isPolling` reads no
operation | stays busy until the operation settles |
| Checkout parked awaiting a card | no recovery prompt | recovery
prompt, as on the legacy rail |
| Declined attempt | no reason shown | the decline reason, as on the
legacy rail |
| Reconciliation needed | no prompt | the reconciliation prompt |

No capture is attached: reaching this state needs an authenticated
unified-cloud session with the flag on and a live subscribe parked on a
hosted step, which is not reproducible from a local checkout —
`operations` is a private ref inside `billingSdkStore`, written only by
the lifecycle, and there is no dev harness for it. Reviewers should
exercise it in a preview environment with the flag on by starting a
subscribe that lands on a verification step and watching the dialog
before completing it. Flag off, every one of these reads is the legacy
store exactly as today.

## Testing

- `useSubscriptionCheckout.test.ts` — a parked operation read off the
lifecycle on the rail and off the poller when the rail is null,
asserting `parkedCheckoutRecovery`, `authenticationState` and
`authenticationError` on each; plus a two-row table over the flag
proving a legacy-transport `pending_payment` registers exactly one
poller, with the second row being the 404-fallback case the section
above turns on.
- `useDowngradeToPersonal.test.ts` — the pending-payment registration
tightened from "called with" to "called once", so a rail branch that
added a second registration at that site fails.
- `operationRecordView.test.ts` and the store suite pass unchanged with
`errorMessage` added.

`pnpm test:unit src/platform/workspace src/composables/billing` (91
files, 1956 tests), `pnpm typecheck` and `pnpm lint` pass.

Note for whoever merges second: this touches `operationRecordView.ts`
alongside PR 8 (Comfy-Org#18133), which adds `actionUrl` validation to the same
projection. Different lines, trivial rebase.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 7**, one of the three switches PR 1 unblocked. Parallel to
PRs 8 and 9.

FE-2481's other half — the single `proration_at` rule — stays in PR 11,
which waits on the backend answer.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| **7** | **FE-2480 + FE-2481 (poller half)** | **checkout reads its
operation off the rail** | **this PR** |
| 8 | FE-2482 | subscription panel reads the SDK store | open — Comfy-Org#18133 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
needs 1 |
| 10 | FE-2474 | top-up dialog reads through its adapter | open — Comfy-Org#18132
|
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR1["PR 1 · FE-2469<br/>merged"] --> PR7["PR 7 · FE-2480 + FE-2481<br/>checkout reads on the rail"]:::here
  PR1 --> PR8["PR 8 · FE-2482"]
  PR1 --> PR9["PR 9 · FE-2484 + FE-2483 + FE-2485"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 6, 10, 11, 12<br/>independent"]

  PR7 --> BAKE["Step 3 · staging bake"]
  PR8 --> BAKE
  PR9 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2480
- Part of FE-2481
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 20, 2026
## Why

No spec under `browser_tests` sets `billing_sdk_topup_enabled`. Comfy-Org#17665
shipped the top-up rail with 48 dual-path unit tests and no browser
coverage, so the first flow due to be flagged on in staging (FE-2486
ramps top-up first) is the one flow with no end-to-end proof. Plan
change and cancel both have off / on / 404 specs; top-up had none.

## How

`browser_tests/tests/dialogs/topUpSdkRail.spec.ts`, modelled on
`planChangeSdkRail.spec.ts`. Both rails POST `/api/billing/topup`, so
the request body cannot separate them. Two things can, and the spec
asserts both rather than only the outcome:

- **transport** — the SDK runs on `fetch`, the legacy workspace client
on axios' XHR adapter
- **`Idempotency-Key`** — only the SDK sends one, and the body's
`idempotency_key` must match the header

The flag goes through `FeatureFlagHelper.seedServerFlags`, never by
stubbing `GET /api/features` — that response carries `firebase_config`,
and a stub signs the session out silently.

Three rows: the legacy call with the rail off, the SDK call with it on,
and a closed backend gate. Each also asserts the balance is re-read
after the purchase settles, which is the customer-visible end of the
flow on both rails.

## What this found: the top-up rail has no 404 fallback

FE-2475's third scope bullet asked for "the `NOT_AVAILABLE` latch falls
back to the legacy call once, and the purchase still completes". **That
latch does not exist.**

`account-core` does mint the code — `topup.ts:226` maps a 404 to
`NOT_AVAILABLE` — but nothing in `src/` reads it. There is no occurrence
of `NOT_AVAILABLE` anywhere in the app. Compare the subscription rail,
which has `subscriptionRouteAvailable` in `billingSdkStore.ts:334` and
`onSubscriptionRail` → `DECLINED` → `workspaceApi` in
`useWorkspaceBilling.ts:445`. Top-up has neither the latch nor the
retry: `useTopupOperation.topup` returns `sdkStore.createTopup(...)` and
a 404 comes back out as a `WorkspaceApiError`.

So with the flag on before the backend route is deployed, **every top-up
fails** and the customer sees an error toast. That is a ramp-ordering
risk on the exact flag FE-2486 turns on first.

The third row pins that behaviour as it actually is rather than as the
ticket assumed, because a spec that asserted the intended fallback would
simply be red and tell nobody anything. Closing the gap is a source
change and needs its own ticket; when it lands, this row is the one that
gets rewritten, and it is written to make that obvious.

## AS IS / TO BE

**No product change** — this PR adds a spec file and touches no source.
There is nothing to capture; what changes is what CI proves about code
already on `main`.

## Testing

- `topUpSdkRail.spec.ts` (new, `@cloud`) — three rows as above.
- `pnpm typecheck`, `pnpm typecheck:browser` and `pnpm lint` pass.

**This spec has not been executed locally.** It needs a cloud backend on
`:8188`, which this checkout has no access to, so CI is its first run.
Reviewers should treat a red `@cloud` shard here as the spec's own
problem rather than a regression, and I will chase it.

## Plan position

Milestone 1, Step 1b — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 13**, backfill for code already on `main` (Comfy-Org#17665),
independent of every Step 1 PR.

| PR | Step | Tickets | What | Status |
| --- | --- | --- | --- | --- |
| 1 | 1 | FE-2469 | operation-state projections | merged — Comfy-Org#18036 |
| 2 | 1 | FE-2467 | billing events reader | open — Comfy-Org#18042 |
| 3 | 1 | FE-2479 | usage log on the rail | open — Comfy-Org#18047 |
| 4 | 1 | FE-2468 | payment recovery on the rail | open — Comfy-Org#18060 |
| 5 | 1 | FE-2470 | team checkout on the rail | open — Comfy-Org#18136 |
| 6 | 1 | FE-2471 | one status reader | open — Comfy-Org#18092 |
| 7 | 1 | FE-2480 + FE-2481 | checkout reads on the rail | open — Comfy-Org#18134
|
| 8 | 1 | FE-2482 | subscription panel on the rail | open — Comfy-Org#18133 |
| 9 | 1 | FE-2484 + FE-2483 + FE-2485 | recovery on the rail | open —
Comfy-Org#18135 |
| 10 | 1 | FE-2474 | top-up dialog adapter | open — Comfy-Org#18132 |
| 11 | 1 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | 1 | FE-2472 | table-driven safety net | open — Comfy-Org#18137 |
| **13** | **1b** | **FE-2475** | **top-up rail E2E** | **this PR** |
| 14 | 1b | FE-2476 | six reads E2E | needs 3 |
| 15 | 1b | FE-2477 | resubscribe + portal E2E | independent |

```mermaid
flowchart LR
  PR13["PR 13 · FE-2475<br/>top-up rail E2E"]:::here
  STEP1["Step 1 · PRs 1-12"]
  PR3["PR 3 · FE-2479"] --> PR14["PR 14 · FE-2476"]
  PR15["PR 15 · FE-2477"]

  STEP1 --> BAKE["Step 3 · staging bake"]
  PR13 --> BAKE
  PR14 --> BAKE
  PR15 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp<br/>top-up first"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2475
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 20, 2026
…cycle (Comfy-Org#18135)

## Why

Recovery is the path a customer takes after a redirect checkout, a
reload mid-payment, or a flag flip while an operation is pending. It has
two entry points, and with `billing_sdk_subscription_enabled` on both of
them hand the operation to the wrong driver.

- `useWorkspaceBilling.resumePendingOperation` (`:304`) gives a pending
operation to the SDK **only** when the server calls it a top-up. A
pending `subscription` at load starts the legacy poller, for an
operation whose writes went through the SDK.
- `useSubscriptionDialog.resumePendingCheckout` (`:293`) has no rail
branch at all. That is the path a customer takes when they return to a
parked checkout, so on the rail it starts a legacy poller for an
operation the lifecycle already owns.

Shipping either alone leaves recovery half-railed, which is the exact
ambiguity FE-2484 exists to remove — so the two ship together, with the
browser proof FE-2485 asks for.

## Root cause

Comfy-Org#17665 railed top-up and railed its recovery with it, because top-up was
the flow being moved. The subscription commands were railed later
(Comfy-Org#17853, and the checkout in Comfy-Org#18036's follow-ups) and nothing went back
to the resume paths. `pending_billing_op_type === 'topup'` was never a
rule — it was the shape of the one flow that had a rail at the time,
left in place as the condition.

## How

**`railOwnsResume(type)`** replaces that condition in
`useWorkspaceBilling`. Each kind of pending operation follows the rail
that issues it: `topup` on `billingSdkTopupRailEnabled`, everything else
on `billingSdkSubscriptionRailEnabled`. A server predating
`pending_billing_op_type` only ever had subscriptions to hand back, so
an absent field follows the subscription rail — the same reading
`resumeModeFor` already takes of it.

`'cancel'` is named in the ticket but is not a value this field can
hold: the response type is `'topup' | 'subscription' | undefined`, and
`resumeModeFor`'s `never` branch is what holds that. A cancel pending at
load is reported as a subscription operation and is covered by the same
branch.

**`billingSdkStore.recoverPendingOperation(opId)`** is new, for the
caller that has something to decide on the outcome.
`lifecycle.recover()` resolves at *adoption*, not at settlement, and the
dialog needs the terminal status to know whether to reopen the pricing
table. So this awaits the projection settling, and returns `undefined`
when there is nothing to adopt — either the read failed, or the server
named a different operation, which means the pointer this caller held is
stale.

**`useSubscriptionDialog.resumePendingCheckout` branches on the rail**
and gets one new behaviour out of it: an `undefined` result clears the
stale pointer instead of leaving it parked. The owner/workspace guard
above it is untouched, and so is the host pointer
`comfy:pending-subscription-checkout` — it carries the tier/cycle
selection the pricing dialog restores, which the SDK's scope-keyed
pointer deliberately does not. Only who drives the operation moves.

## AS IS / TO BE

With `billing_sdk_subscription_enabled` on and a subscription operation
pending at load:

| | AS IS | TO BE |
| --- | --- | --- |
| Server reports a pending subscription | legacy poller starts on an
SDK-owned operation | `lifecycle.recover()` adopts it; no legacy poller
|
| Customer returns to a parked checkout | legacy poller starts |
`recoverPendingOperation` adopts it |
| Pointer left by a pre-flip session | polled on the rail it was not
issued on | adopted by the lifecycle |
| Recovery finds nothing to adopt | pointer stays parked indefinitely |
pointer cleared |

No still capture is attached: there is no visual difference to
photograph — both rails render the same checkout dialog, and what
changed is which transport polls the operation behind it.
`operationRecoverySdkRail.spec.ts` is the evidence, and it asserts
exactly that discriminator. Flag off, both entry points behave as they
do today, which the spec's first row holds.

## Testing

- `operationRecoverySdkRail.spec.ts` (new, `@cloud`) — three browser
rows against the same mocked pending operation. Both rails poll `GET
/api/billing/ops/{id}`, so the request body cannot separate them; the
transport can, as in `planChangeSdkRail`: the SDK runs on `fetch`, the
legacy workspace client on axios' XHR. Rail off, no poll is a `fetch`.
Rail on, the operation is adopted **exactly once, on one rail** — see
the race note below for why this row cannot assert *which* rail without
flaking. And a failed recovery still reopens the checkout on the Creator
annual plan the host pointer recorded, then clears it.

- `useWorkspaceBilling.sdk.test.ts` — a five-row table over (op type ×
topup rail × subscription rail) pinning which side adopts, including the
two rows that prove the rails do not cross: a pending top-up with only
the subscription rail on stays on the poller, and a pending subscription
with only the top-up rail on stays on the poller.
- `useSubscriptionDialog.test.ts` — a two-row table over the rail: each
adopts through its own driver and neither through the other's, and the
pricing dialog reopens on the recorded tier/cycle either way. Plus the
stale-pointer row, which is the new behaviour.
- `billingSdkStore.test.ts` — `recoverPendingOperation` resolving with
the settled record, and returning `undefined` both when the server names
another operation and when the recovery read fails.

`pnpm test:unit src/platform/workspace src/composables/billing
src/platform/cloud` (145 files, 2607 tests), `pnpm typecheck`, `pnpm
typecheck:browser` and `pnpm lint` pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 9**, the last of the three switches PR 1 unblocked. It
carries FE-2485 rather than leaving it for Step 1b, because it proves
new code: E1–E3 stay separate PRs because they backfill code already on
`main`.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| 7 | FE-2480 + FE-2481 | checkout reads its operation off the rail |
open — Comfy-Org#18134 |
| 8 | FE-2482 | subscription panel reads the SDK store | open — Comfy-Org#18133 |
| **9** | **FE-2484 + FE-2483 + FE-2485** | **recovery through the SDK
lifecycle** | **this PR** |
| 10 | FE-2474 | top-up dialog reads through its adapter | open — Comfy-Org#18132
|
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR1["PR 1 · FE-2469<br/>merged"] --> PR9["PR 9 · FE-2484 + 2483 + 2485<br/>recovery on the rail"]:::here
  PR1 --> PR7["PR 7 · FE-2480 + FE-2481"]
  PR1 --> PR8["PR 8 · FE-2482"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 6, 10, 11, 12<br/>independent"]

  PR9 --> BAKE["Step 3 · staging bake"]
  PR7 --> BAKE
  PR8 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2484
- Part of FE-2483
- Part of FE-2485
christian-byrne pushed a commit to christian-byrne/ComfyUI_frontend that referenced this pull request Sep 20, 2026
…r rail (Comfy-Org#18140)

## Why

Comfy-Org#17940 (status, balance), Comfy-Org#17942 (plans), Comfy-Org#17946 (capabilities, saved
payment methods) and Comfy-Org#18047 (billing events) moved every billing read
onto the SDK readers behind `useBillingReadRail`. **None of the four
shipped a browser spec.**

Nothing under `browser_tests/` referenced `billingSdkTopupRailEnabled`
or `billingSdkSubscriptionRailEnabled` before this stack, so the reader
rail — six routes feeding five rendered surfaces — has never been
exercised end to end. The int64 → number projections
(`safeInt64.asSafeNumber`, `projectBillingStatus`,
`projectBillingPlans`) are well unit-tested but had never been run
against a rendered value, which is the only place a silently rounded
amount would show.

## How

`browser_tests/tests/dialogs/billingReadsSdkRail.spec.ts`. Both rails
GET the same six routes, so the URL cannot separate them; the transport
can, as in the write-rail specs — the SDK runs on `fetch`, the legacy
workspace client on axios' XHR.

Settings ▸ Workspace ▸ Plan & Credits is the one surface that drives all
six, so the spec opens it once per row and asserts across the whole set
rather than route by route.

**Rows 1 and 2 are the parity pair.** Rail off: every route this flow
drives is read and *no* read went out on `fetch`. Rail on: the same
routes are read and *no* read went out on `xhr` — one leaking read would
mean a surface reading a backend the rail did not settle. Both rows
assert the same rendered values (the credits total, the usage-log row),
so the projections are pinned against a rendered surface rather than
against each other.

**Five of the six reads, not all six.** Saved payment methods is not
read by this panel — the top-up dialog reads it for its saved-card note
— so it belongs to `topUpSdkRail.spec.ts` (Comfy-Org#18138) rather than here.
Asserting it from this flow would mean driving a dialog this spec has no
other reason to open. The other five are all here, billing events
included, which is the read this ticket was widened for.

**The usage log is behind the panel's Activity tab.** The Credits tab it
opens on never mounts `UsageLogsTable`, so the events read does not go
out until that click — which is what the first CI runs of this spec
showed.

**Row 3 is the int64 case.** A balance of `9007199254740993` micros is
beyond `Number.MAX_SAFE_INTEGER`; the projection must refuse the read
rather than render a number off by an unknown amount. The fixture is
sent as **raw JSON rather than a JS literal** — written as a literal the
digits would be lost in the test file before the app ever saw them,
which would make the row assert nothing. `no-loss-of-precision` flagged
exactly that, and the raw body is the fix.

**Row 4 is the paging case Comfy-Org#18047 introduced.** The events reader is
scoped *and* paged, and `scopedReader` used to key an in-flight read on
scope alone — so a caller wanting page 2 could be handed page 1's
answer. The row pages forward and asserts page 2 issued its own request
and rendered its own row.

## Widened to six reads

FE-2476 originally covered five. The milestone plan left a choice open
before PR 3 could open — widen this ticket to six and stack it behind PR
3, or carry the events row inside PR 3 — and **widening won**: there was
no reader-rail spec to add a row to, so "the events row inside PR 3"
would have meant building the first rail-flag E2E harness inside an
adoption PR. The cost is that this PR is no longer independent of Step
1; it stacks on PR 3.

The `SUPERSEDED` row the ticket also names is not here. A superseded
read is a scope change under an in-flight request, which needs a
workspace switch mid-load; driving that reliably in a browser needs a
harness this spec does not have, and `UsageLogsTable.vue:181` already
discards an undefined response under unit test. Left for a follow-up
rather than written as a flaky row.

## AS IS / TO BE

**No product change** — this PR adds a spec file and touches no source.
There is nothing to capture; what changes is what CI proves about code
already on `main` and on the PR 2/3 stack.

## Testing

- `billingReadsSdkRail.spec.ts` (new, `@cloud`) — four rows as above.
- `pnpm typecheck`, `pnpm typecheck:browser` and `pnpm lint` pass.

**This spec has not been executed locally.** It needs a cloud backend on
`:8188`, which this checkout has no access to, so CI is its first run.
Reviewers should treat a red `@cloud` shard here as the spec's own
problem rather than a regression, and I will chase it.

## Plan position

Milestone 1, Step 1b — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 14**. It targets PR 2's branch, which now carries PR 3
(Comfy-Org#18047 merged into it), because the sixth read only exists there.

| PR | Step | Tickets | What | Status |
| --- | --- | --- | --- | --- |
| 1 | 1 | FE-2469 | operation-state projections | merged — Comfy-Org#18036 |
| 2 | 1 | FE-2467 | billing events reader | open — Comfy-Org#18042 |
| 3 | 1 | FE-2479 | usage log on the rail | merged into 2 — Comfy-Org#18047 |
| 4 | 1 | FE-2468 | payment recovery on the rail | open — Comfy-Org#18060 |
| 5 | 1 | FE-2470 | team checkout on the rail | open — Comfy-Org#18136 |
| 6 | 1 | FE-2471 | one status reader | open — Comfy-Org#18092 |
| 7 | 1 | FE-2480 + FE-2481 | checkout reads on the rail | open — Comfy-Org#18134
|
| 8 | 1 | FE-2482 | subscription panel on the rail | open — Comfy-Org#18133 |
| 9 | 1 | FE-2484 + FE-2483 + FE-2485 | recovery on the rail | open —
Comfy-Org#18135 |
| 10 | 1 | FE-2474 | top-up dialog adapter | open — Comfy-Org#18132 |
| 11 | 1 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | 1 | FE-2472 | table-driven safety net | open — Comfy-Org#18137 |
| 13 | 1b | FE-2475 | top-up rail E2E | open — Comfy-Org#18138 |
| **14** | **1b** | **FE-2476** | **six reads E2E** | **this PR** |
| 15 | 1b | FE-2477 | resubscribe + portal E2E | open — Comfy-Org#18139 |

```mermaid
flowchart LR
  PR2["PR 2 · FE-2467<br/>+ PR 3 · FE-2479"] --> PR14["PR 14 · FE-2476<br/>six reads E2E"]:::here
  STEP1["Step 1 · PRs 1, 4-12"]
  PR13["PR 13 · FE-2475"]
  PR15["PR 15 · FE-2477"]

  STEP1 --> BAKE["Step 3 · staging bake"]
  PR13 --> BAKE
  PR14 --> BAKE
  PR15 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2476
pull Bot pushed a commit to Mu-L/ComfyUI_frontend that referenced this pull request Sep 20, 2026
…rg#18133)

## Why

`SubscriptionPanelContentWorkspace.vue` decides whether to show the
"setting up your subscription" banner, and whether to offer the Complete
verification button inside it, by reading `billingOperationStore` —
`:445` for `isSettingUp`, `:447` for
`subscriptionActionOperation?.actionUrl`. Neither read has a rail
branch.

With `billing_sdk_subscription_enabled` on, the operation those two
values describe is owned by the SDK lifecycle. The legacy store has no
record of it, so the panel renders the plan tile as though nothing were
in flight: no banner while the subscription is being set up, and no way
through when the customer still owes a hosted verification step.

## Root cause

FE-2469 named this the last half of `billingOperationStore` to move: the
store was the poller *and* the view-model, and the SDK replaced the
poller only. The commands were railed by Comfy-Org#17853 and Comfy-Org#17665, so a
subscribe already issues through the SDK — but the two predicates the
panel reads had no counterpart on the SDK store, so they could not
follow.

PR 1 (Comfy-Org#18036) added them. This PR is the switch they were added for.

## How

**`useSubscriptionOperationView()`** joins `useSubscriptionRail()` in
`useSubscriptionRail.ts` — the same flag, read once, for the same reason
the commands read it once: a flip mid-operation must not have the panel
observe on a rail the operation was not issued on. It answers the two
questions the panel asks and nothing else, from `billingSdkStore` when
the rail is on and from `billingOperationStore` when it is off.

It is a read-side sibling rather than a widening of `SubscriptionRail`,
because `SubscriptionRail` is the command interface
`useSubscriptionCheckout` holds; the panel issues nothing.

**The panel loses its `useBillingOperationStore` import and both
computeds** for one destructure. `openSubscriptionVerification` and the
template are untouched.

**`projectOperationRecord` now validates `actionUrl`**
(`operationRecordView.ts`). This is a parity gap PR 1 left: the legacy
store validates the URL at registration
(`billingOperationStore.ts:253`), so a legacy record's `actionUrl` is
https-or-null by the time a surface reads it, while the projection
carried the SDK's value through raw. Both this panel and
`useSubscriptionCheckout` hand that value to `window.open`, so the
projection has to make the same guarantee the record it mirrors makes.
`account-core` exports the same `validateActionUrl` the SDK store
already uses for `subscriptionActionUrl`, so this is one predicate, not
a second copy.

## AS IS / TO BE

No screenshot — the state this PR changes is not reachable on a local
build. `billingSdkSubscriptionRailEnabled` is
`billingSdkSubscriptionEnabled && unifiedCloudAuthEnabled`, so the rail
is only on inside an authenticated unified-cloud session, and
`isSettingUp` / `subscriptionActionOperation` are computed off
`billingSdkStore`'s private `operations`, which only the SDK lifecycle's
poll of a live backend operation writes. There is no story for
`SubscriptionPanelContentWorkspace`, no dev harness for the lifecycle,
and no writable surface on the store, so nothing short of a real
subscribe parked on a hosted verification step renders the banner.
Rather than stage a fake, the two frames are described:

| | |
| --- | --- |
| **AS IS** | The plan tile as normal while an SDK-owned subscribe is in
flight: no "setting up your subscription" spinner banner and no
**Complete verification** button, because the legacy store holds no
record of the operation. |
| **TO BE** | The spinner banner
(`billingOperation.subscriptionProcessing`), and inside it the
**Complete verification** button for a role with
`canManageSubscription`, opening the hosted step. |

To exercise it in a preview environment: with
`billing_sdk_subscription_enabled` on, start a subscribe that lands on a
hosted verification/3DS step, then open the subscription panel before
completing it. On this branch the banner and the button are there; on
`main` the panel shows the plan tile as though nothing were pending.
Flag off, the panel is unchanged — the legacy store answers both reads
exactly as it does today.

## Testing

- `useSubscriptionOperationView.test.ts` — the poller answers both reads
with the rail off and the SDK is never constructed; the lifecycle
answers both with the rail on while the poller holds nothing; a two-row
table over the rail proving neither rail offers another workspace's
hosted step (the lifecycle keeps operations from a scope it has left, so
the filter is load-bearing, not incidental); and a non-https step
refused on the SDK rail.
- `operationRecordView.test.ts` — a row for the `javascript:` step the
projection now refuses, alongside the https step it carries.

`pnpm test:unit src/platform/workspace src/composables/billing` (92
files, 1958 tests), `pnpm typecheck` and `pnpm lint` pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 8**, one of the three switches PR 1 unblocked. Parallel to
PRs 7 and 9; no ordering between them.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| 7 | FE-2480 + FE-2481 | stop registering a second poller | needs 1 |
| **8** | **FE-2482** | **subscription panel reads the SDK store** |
**this PR** |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
needs 1 |
| 10 | FE-2474 | top-up dialog reads through its adapter | open — Comfy-Org#18132
|
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR1["PR 1 · FE-2469<br/>merged"] --> PR8["PR 8 · FE-2482<br/>panel on the rail"]:::here
  PR1 --> PR7["PR 7 · FE-2480 + FE-2481"]
  PR1 --> PR9["PR 9 · FE-2484 + FE-2483 + FE-2485"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 6, 10, 11, 12<br/>independent"]

  PR8 --> BAKE["Step 3 · staging bake"]
  PR7 --> BAKE
  PR9 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2482
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 21, 2026
…ption store (Comfy-Org#18092)

## Why

`performFetchSubscriptionStatus` in `useSubscription.ts` read billing
status straight off `workspaceApi.getBillingStatus()` with no rail
branch, in parallel with `useWorkspaceBilling.fetchStatus` (`:336`)
which has taken `useBillingReadRail()` since FE-2216. Two status
readers, one railed and one not.

With either billing SDK flag on, that is two clients answering the same
question. The unrailed one is the earlier of the two: it fires on the
auth watch at bootstrap, and its response is what writes
`workspaceStore.setWorkspaceBillingRail`. So the read that feeds the
legacy-versus-workspace routing decision was the one read still going
through the client the rail replaced.

## The decision

FE-2471 is a decision ticket. It offers two options, and this PR takes
**option 1 — read on the rail here as well, keeping two readers but one
transport.**

**Option 2, delegating to `useWorkspaceBilling.fetchStatus` and deleting
this fetch, is rejected on layering.** This read's response is the input
to the routing decision: `setWorkspaceBillingRail` feeds
`workspaceStore.activeWorkspaceBillingRail`, which
`useBillingRouting.ts:31` reads to choose between `useLegacyBilling` and
`useWorkspaceBilling`. Delegating puts that input inside one of the two
adapters being chosen between — and `useLegacyBilling.ts:49` reads this
very composable, so the legacy adapter would have to call the workspace
adapter to learn which adapter it should be. At bootstrap
`activeWorkspace?.type` is undefined, `useBillingRouting.type` is
therefore `'legacy'`, and the value that would settle it has not been
read yet.

Two further costs make it the wrong move for Step 1:

- **`useWorkspaceBilling.fetchStatus` carries side effects a bootstrap
read must not acquire.** It writes `seatCapacity` (`:349`) and calls
`resumePendingOperation` (`:304`), which registers a legacy poller or
calls `sdk.recover()`. That is precisely the code PRs 7 and 9 are
rewriting; making app bootstrap enter it would widen their blast radius
for no gain.
- **Its staleness fence is workspace-shaped.** `isStaleStatusRead`
(`:326`) drops any read whose captured `activeWorkspace?.id` no longer
matches, where this composable fences on `(userId, activeWorkspaceId)` —
the identity pair a user-scoped bootstrap read actually needs, and the
one the "identity switch" test in this file pins.

What the ticket's title complains about is better read as two
*transports* than two readers, and one transport is what this PR leaves.
**The consequence for the plan: FE-2495 (M1-26) closes as not needed** —
its own description says to close it if option 1 is chosen.

## How

The read comes out of `performFetchSubscriptionStatus` into
`readSubscriptionStatus`, which takes `useBillingReadRail()` and holds
it for that read — a flag flip mid-read must not start on one client and
publish through the other:

```ts
async function readSubscriptionStatus(): Promise<BillingStatusResponse | undefined> {
  const rail = useBillingReadRail()
  try {
    return rail
      ? await readOnRail(rail.readStatus)
      : await workspaceApi.getBillingStatus()
  } catch (error) {
    throw new AuthStoreError(
      t('toastMessages.failedToFetchSubscription', { … })
    )
  }
}
```

Splitting it is worth a word, since the rail branch alone would have
been three lines inline. Reading and publishing are two concerns, and
only the first one grew: which client answers and how its failure is
shaped now sit in one named function, leaving the caller with the scope
guards and the publish. It also drops a `let` that was assigned in a
`try`. Inline, the branch tipped `performFetchSubscriptionStatus` over
fallow's CRAP threshold (37.1 against 30, `introduced: true`);
extracting puts it back under without touching a test.

`readOnRail` returns `undefined` on `SUPERSEDED`, so the status is
optional and a superseded read returns `null` before the publish — no
status, no `setWorkspaceBillingRail`, no
`syncPendingSubscriptionSuccess`. That is the same nothing the identity
guard directly below produces from a read whose owner or workspace has
changed, which is why it sits next to it rather than in its own branch.

Nothing else moved. The error path is behaviourally untouched: a failed
rail read throws `WorkspaceApiError` out of `readOnRail` and hits the
same `catch`, wrapped in the same `AuthStoreError` with the same
`failedToFetchSubscription` message the legacy throw produced. The
in-flight dedupe, the pending-checkout telemetry and the `billing_rail`
write are all as they were.

This is the same shape FE-2216 gave `useBillingPlans.fetchPlans` in
Comfy-Org#17942 — the closest precedent, a cloud subscription composable reading
through `useBillingReadRail` with a superseded read publishing nothing.

## AS IS / TO BE

**No user-visible change, on either rail.** Same status, same panels,
same gate. What changes is which client answers.

| | AS IS (flag on) | TO BE (flag on) |
| --- | --- | --- |
| bootstrap status read | `workspaceApi.getBillingStatus()` |
`readStatus` on the read rail |
| `setWorkspaceBillingRail` source | legacy client's response | the
rail's response |
| superseded scope | stale read published | nothing published |
| flag off | `workspaceApi.getBillingStatus()` | unchanged |

Worth stating explicitly, since the read is on the bootstrap path: **the
rail read has no weaker auth precondition than the legacy one.** Under
`unified_cloud_auth` — the flag these billing rails ramp behind —
`getWorkspaceAuthHeader` returns the unified token or null, and a null
throws `userNotAuthenticated` without waiting; the SDK's scope source
reads the same unified session and answers `NOT_AUTHENTICATED` when it
is not established. Both paths need a minted unified session, so railing
this read adds no new unauthenticated-bootstrap window.

A before/after capture would show the same screen, so none is attached.

## Testing

`useSubscription.test.ts` — the two behaviours that hold on both clients
are now rows over both, so the rail path is pinned by the same
assertions as the legacy path rather than by a copy:

- **publishes a status read through `$reader` and updates the workspace
billing rail** — over the workspace client and the SDK reader. Each row
also asserts the *other* client was never called, which is the
one-transport claim the ticket is about.
- **reports a failed read through `$reader` in the same message** — a
legacy rejection and a rail `ACCESS_DENIED` both surface as `Failed to
fetch subscription status: …`.
- **keeps the published status when a rail read is superseded** —
rail-only: a good status is published first, then a `SUPERSEDED` read
resolves `null` and leaves it standing.

These replace the three legacy-only cases they subsume (`should fetch
subscription status successfully`, `should handle fetch errors
gracefully`, `updates the active workspace billing rail from status`)
with no loss of legacy coverage — the legacy row asserts strictly more
than the case it replaced.

Reverting the source change and re-running fails exactly the three rail
cases; the legacy rows pass on both sides, which is the flag-off half of
the dual path.

`pnpm vitest run src/platform/cloud src/platform/workspace
src/composables/billing` (145 files, 2598 tests), `pnpm typecheck`,
`pnpm lint` and `pnpm knip` all pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 6**, independent: it depends on nothing in Step 1 and
blocks nothing in it. Its output is a plan change rather than a
dependency — it closes FE-2495 out of Step 5.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged
(Comfy-Org#18036) |
| 2 | FE-2467 | billing events reader in `account-core` | open (Comfy-Org#18042)
|
| 3 | FE-2479 | usage log reads on the SDK rail | open (Comfy-Org#18047), stacked
on 2 |
| 4 | FE-2468 | payment recovery reads on the rail | open (Comfy-Org#18060) |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| **6** | **FE-2471** | **one status transport for the cloud
subscription store** | **this PR** |
| 7 | FE-2480 + FE-2481 | stop registering a second poller | needs 1 |
| 8 | FE-2482 | subscription panel reads the SDK store | needs 1 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
needs 1 |
| 10 | FE-2474 | top-up dialog reads through its adapter | independent |
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR6["PR 6 · FE-2471<br/>one status transport"]:::here
  PR1["PR 1 · FE-2469<br/>merged"] --> PR7["PR 7 · FE-2480 + FE-2481"]
  PR1 --> PR8["PR 8 · FE-2482"]
  PR1 --> PR9["PR 9 · FE-2484 + FE-2483 + FE-2485"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 10, 11, 12<br/>independent"]

  PR6 --> BAKE["Step 3 · staging bake"]
  PR7 --> BAKE
  PR8 --> BAKE
  PR9 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal<br/>FE-2495 closes as not needed"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

## Review focus

**The decision is the review, not the diff.** The source change is small
and follows Comfy-Org#17942; what needs a second opinion is choosing option 1
over delegation, because that choice retires FE-2495. If you read the
routing cycle differently — or think the two bootstrap round trips are
worth paying the layering cost to remove — this is the PR to say so on,
and FE-2495 should stay open.

Second, the superseded branch returning `null` rather than rescheduling:
a superseded read does not call `syncPendingSubscriptionSuccess`, so it
neither clears nor reschedules pending-checkout recovery. That matches
what a stale legacy read does today at the identity guard, and the
recovery retry is driven separately by the storage/visibility listeners
— but it is the one behavioural edge the rail introduces here.

- Part of FE-2471
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 21, 2026
…Comfy-Org#18137)

## Why

`useSubscriptionCheckout.ts` is 1817 lines behind a 4840-line suite, and
FE-2490 deletes roughly half of it — every legacy branch, once
`billing_sdk_subscription_enabled` has been at 100% for a release cycle.

The existing suite asserts a great deal, but not as a matrix over the
two rails. So a removal PR can go green by deleting the cases that
covered the branch it removed, rather than by showing the behaviour
survived. That is the failure mode this PR exists to close.

## How

A table over **rail × checkoutType × outcome**, added to the existing
suite rather than a new file so it reuses the shared billing fixtures —
the ticket's own constraint, and the reason there are no new mocks here.

- **rail** — legacy and SDK, set through the same `mockSubscriptionRail`
seam the rest of the suite uses.
- **checkoutType** — `new` and `change`, driven by the quote's
`transition_type` exactly as the composable derives it, plus
reactivation as its own pair of rows since it is a flag on a change
rather than a third type.
- **outcome** — the four terminal shapes the projection can hand back: a
subscribe the server settled on the spot, one parked on a billing
operation that then succeeds, one parked on an operation that then
fails, and no response at all.

Each row asserts the same two user-visible things on both rails: the
step the customer is left on, and that the attempt released. The second
is not incidental — a checkout left busy is a dialog the customer can
neither leave nor retry from, and it is the state a half-removed branch
most easily produces.

The rows are sparse. A row names its outcome and the step that outcome
must leave behind; the rail and the checkout type are crossed over it
rather than restated per case, so the table reads as four behaviours
rather than eighteen bodies.

**What gives it teeth against FE-2490.** The two parked rows are the
ones that run `advanceToSuccessOnOperation` — the legacy registration
and the terminal await that Step 5 removes. If that path goes without a
replacement that settles the operation, "parked then settles" stops
reaching the success step on both rails and this table fails, which is
exactly the signal a removal PR needs and does not have today.

## AS IS / TO BE

**No product change.** This PR adds test rows and touches no source
file, so there is nothing to capture; the suite is green before and
after on both rails. What changes is what a future removal has to
survive.

## Testing

- `useSubscriptionCheckout.test.ts` — 18 matrix rows (2 rails × 2
checkout types × 4 outcomes) plus 2 reactivation rows, asserting the
step and the released attempt on each. The file goes from 162 to 180
tests, all passing.

`pnpm test:unit src/platform/workspace src/composables/billing` (91
files, 1970 tests), `pnpm typecheck` and `pnpm lint` pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 12**, independent of every other PR in the step, and the
one Step 5's first removal is checked against.

Note for whoever merges second: this touches
`useSubscriptionCheckout.test.ts` alongside PR 7 (Comfy-Org#18134), which widens
the rail stub in the same file. Different blocks, trivial rebase.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| 5 | FE-2470 | team checkout on the SDK subscribe command | open —
Comfy-Org#18136 |
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| 7 | FE-2480 + FE-2481 | checkout reads its operation off the rail |
open — Comfy-Org#18134 |
| 8 | FE-2482 | subscription panel reads the SDK store | open — Comfy-Org#18133 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
open — Comfy-Org#18135 |
| 10 | FE-2474 | top-up dialog reads through its adapter | open — Comfy-Org#18132
|
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| **12** | **FE-2472** | **table-driven safety net** | **this PR** |

```mermaid
flowchart LR
  PR12["PR 12 · FE-2472<br/>safety net"]:::here
  PR1["PR 1 · FE-2469<br/>merged"] --> PR789["PR 7, 8, 9"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 6, 10, 11<br/>independent"]

  PR789 --> BAKE["Step 3 · staging bake"]
  PR3 --> BAKE
  IND --> BAKE
  PR12 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal<br/>FE-2490 checked against PR 12"]
  PR12 -.-> REMOVE

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2472
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 21, 2026
…omfy-Org#18132)

## Why

`useTopupOperation` owns the rail choice for the top-up dialog — it
picks the SDK store or the legacy poller once, when the dialog opens, so
a flag flip mid-purchase cannot issue on one rail and observe on the
other. The dialog then reaches past it anyway: it imports
`useBillingOperationStore` directly (`:314`), instantiates it (`:343`),
and calls `startOperation` on it after a purchase comes back pending
(`:677`).

With `billing_sdk_topup_enabled` on, that is a direct reference from a
dialog on the SDK rail to a store nothing is driving its operation with.
FE-2474 removes the three lines.

## Root cause

The adapter was extracted from the dialog in Comfy-Org#17665 for the reads and
the commands — `isAddingCredits`, `topupOperation`, `topup`,
`retryPaymentAuthentication`, `dismissOperation`. The
pending-registration was left behind because it is not a read or a
command: it is the dialog asking to be told when an operation it just
issued settles, and on the legacy rail `startOperation` is both the
registration and that notification.

That one call kept the import alive, and with it the dialog's binding to
the legacy store.

## How

**`useTopupOperation.adoptPendingOperation(opId, { attemptStartedAt
})`** is the sixth thing the adapter answers. On the legacy rail it is
the `startOperation` call the dialog made, unchanged — same operation
type, same `autoHandleRequiresAction: true`, same promise that resolves
when the operation settles. On the SDK rail it resolves immediately: the
lifecycle adopted the operation when `createTopup` issued it, so there
is nothing to register, and registering would be a second poller on one
operation.

**The dialog destructures it alongside the other five and drops the
three lines.** The `.then` / `.catch` around the call is unchanged — it
still clears `paymentSubmitted` on settlement and reports a purchase
error on rejection.

One thing worth naming for review: **this call site is already
unreachable on the SDK rail.** `projectTopupResult` maps a settled
result to `completed` or `failed` and an unsettled one to `undefined`,
so `response.status === 'pending'` is a legacy-only shape. The fix is
therefore not a behaviour change on either rail — it is removing the
dialog's ability to reach a store it is not using, which is what makes
the legacy branches deletable in FE-2492 without a search through
component files.

## AS IS / TO BE

**No user-visible change, on either rail.** The legacy rail issues the
same registration with the same arguments; the SDK rail takes a branch
it could not reach before and cannot reach now. A before/after capture
would show two identical top-up dialogs, so none is attached.

## Testing

- `useTopupOperation.test.ts` — a two-row table over the rail asserting
exactly one poller registration per pending top-up: the legacy rail
forwards to `startOperation` with the operation id, type and metadata,
and the SDK rail registers nothing. This is the dual-path assertion the
milestone asks of every rail-touching change.
- `TopUpCreditsDialogContentWorkspace.test.ts` (37 tests) passes
unchanged, which is the point — the dialog's behaviour is identical
through the adapter.

`pnpm test:unit src/platform/workspace` , `pnpm typecheck` and `pnpm
lint` pass.

## Plan position

Milestone 1, Step 1 — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 10**, independent of every other PR in the step.

| PR | Tickets | What | Status |
| --- | --- | --- | --- |
| 1 | FE-2469 | operation-state projections on the SDK store | merged —
Comfy-Org#18036 |
| 2 | FE-2467 | billing events reader in `account-core` | open — Comfy-Org#18042
|
| 3 | FE-2479 | usage log reads on the SDK rail | open — Comfy-Org#18047, needs 2
|
| 4 | FE-2468 | payment recovery reads on the rail | open — Comfy-Org#18060 |
| 5 | FE-2470 | team checkout on the SDK subscribe command | independent
|
| 6 | FE-2471 | one status reader for the cloud subscription store |
open — Comfy-Org#18092 |
| 7 | FE-2480 + FE-2481 | stop registering a second poller | needs 1 |
| 8 | FE-2482 | subscription panel reads the SDK store | needs 1 |
| 9 | FE-2484 + FE-2483 + FE-2485 | recovery through the SDK lifecycle |
needs 1 |
| **10** | **FE-2474** | **top-up dialog reads through its adapter** |
**this PR** |
| 11 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | FE-2472 | table-driven safety net | independent |

```mermaid
flowchart LR
  PR10["PR 10 · FE-2474<br/>top-up dialog adapter"]:::here
  PR1["PR 1 · FE-2469<br/>merged"] --> PR789["PR 7, 8, 9"]
  PR2["PR 2 · FE-2467"] --> PR3["PR 3 · FE-2479"]
  IND["PR 4, 5, 6, 11, 12<br/>independent"]

  PR10 --> BAKE["Step 3 · staging bake"]
  PR789 --> BAKE
  PR3 --> BAKE
  IND --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2474
pull Bot pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Sep 21, 2026
…rtal (Comfy-Org#18139)

## Why

Comfy-Org#17853 put cancel, resubscribe **and** the payment portal on the
subscription rail. `cancelSubscriptionSdkRail.spec.ts` covered cancel
only, so two of the three shipped with no browser case on either rail —
and the portal is the one with the most branching, because Comfy-Org#17922 added
a three-destination cascade behind it.

## How

`browser_tests/tests/dialogs/subscriptionLifecycleSdkRail.spec.ts`, a
sibling of the cancel spec rather than an extension of it: both actions
need a cancelled subscription and a populated plan catalog, which the
cancel spec's active-subscription fixture does not have.

Six rows plus the cascade.

**Resubscribe — off / on / 404.** Same discriminator as cancel: the SDK
transport runs on `fetch` and sends an `Idempotency-Key` matching the
body's `idempotency_key`; the legacy workspace client runs on axios' XHR
and sends neither. The 404 row proves the fallback fires once and the
second attempt is the legacy one.

**The six-row `/api/billing/plans` fixture** is the gap Comfy-Org#17853's
evidence run recorded. The Reactivate plan button reads the catalog to
name the plan being resumed, so an empty or one-row `plans` response
never renders it — which is why resubscribe had no browser case to
extend in the first place.

**Payment portal — off / on / 404,** with one assertion that is
deliberately a non-defect: `openPaymentPortal` carries **no**
idempotency key on either rail, because it is a plain POST outside the
operation lifecycle. The spec asserts its absence rather than treating
it as missing, so a later change that adds one is noticed rather than
assumed correct.

**The blocked-popup cascade.** `manageSubscription` tries three
destinations in order — the hosted billing-web page, then the rail, then
the legacy call — and each opens a different page, so a browser refusing
one says nothing about the next. The last row refuses every
`window.open` and asserts the rail is still asked and the legacy call
still runs after it. A refused tab must not be read as "the portal is
handled", which is the regression Comfy-Org#17922 fixed.

The `window.open` stand-in is the one from
`hostedBillingDestination.spec.ts` — a proxy that records the
destination instead of navigating, so a disowned-tab open cannot steer
the test page — extended to record more than one destination, since the
cascade opens several.

## AS IS / TO BE

**No product change** — this PR adds a spec file and touches no source.
There is nothing to capture; what changes is what CI proves about code
already on `main`.

## Testing

- `subscriptionLifecycleSdkRail.spec.ts` (new, `@cloud`) — 7 rows as
above.
- `pnpm typecheck`, `pnpm typecheck:browser` and `pnpm lint` pass.

**This spec has not been executed locally.** It needs a cloud backend on
`:8188`, which this checkout has no access to, so CI is its first run.
Reviewers should treat a red `@cloud` shard here as the spec's own
problem rather than a regression, and I will chase it.

## Plan position

Milestone 1, Step 1b — [PR
plan](https://linear.app/comfyorg/document/milestone-1-pr-plan-605f42c5e709).
This is **PR 15**, backfill for code already on `main` (Comfy-Org#17853, Comfy-Org#17922),
independent of every Step 1 PR and of the other two Step 1b PRs.

| PR | Step | Tickets | What | Status |
| --- | --- | --- | --- | --- |
| 1 | 1 | FE-2469 | operation-state projections | merged — Comfy-Org#18036 |
| 2 | 1 | FE-2467 | billing events reader | open — Comfy-Org#18042 |
| 3 | 1 | FE-2479 | usage log on the rail | open — Comfy-Org#18047 |
| 4 | 1 | FE-2468 | payment recovery on the rail | open — Comfy-Org#18060 |
| 5 | 1 | FE-2470 | team checkout on the rail | open — Comfy-Org#18136 |
| 6 | 1 | FE-2471 | one status reader | open — Comfy-Org#18092 |
| 7 | 1 | FE-2480 + FE-2481 | checkout reads on the rail | open — Comfy-Org#18134
|
| 8 | 1 | FE-2482 | subscription panel on the rail | open — Comfy-Org#18133 |
| 9 | 1 | FE-2484 + FE-2483 + FE-2485 | recovery on the rail | open —
Comfy-Org#18135 |
| 10 | 1 | FE-2474 | top-up dialog adapter | open — Comfy-Org#18132 |
| 11 | 1 | FE-2481 | one `proration_at` rule | backend answer |
| 12 | 1 | FE-2472 | table-driven safety net | open — Comfy-Org#18137 |
| 13 | 1b | FE-2475 | top-up rail E2E | open — Comfy-Org#18138 |
| 14 | 1b | FE-2476 | six reads E2E | needs 3 |
| **15** | **1b** | **FE-2477** | **resubscribe + portal E2E** | **this
PR** |

```mermaid
flowchart LR
  PR15["PR 15 · FE-2477<br/>resubscribe + portal E2E"]:::here
  STEP1["Step 1 · PRs 1-12"]
  PR13["PR 13 · FE-2475"]
  PR3["PR 3 · FE-2479"] --> PR14["PR 14 · FE-2476"]

  STEP1 --> BAKE["Step 3 · staging bake"]
  PR13 --> BAKE
  PR14 --> BAKE
  PR15 --> BAKE
  BAKE --> RAMP["Step 4 · production ramp"] --> REMOVE["Step 5 · legacy removal"]

  classDef here fill:#f2994a,stroke:#b35c00,color:#1a1a1a,font-weight:bold
```

- Part of FE-2477
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