Skip to content

FE-3118 feat(billing-web): report the payment method, promo and blocked-pay choices - #19822

Merged
dante01yoon merged 17 commits into
jaewon/fe-3118-billing-web-checkout-journey-and-choice-eventsfrom
jaewon/fe-3118-billing-web-checkout-journey-and-choice-events-3
Oct 1, 2026
Merged

dante01yoon merged 17 commits into
jaewon/fe-3118-billing-web-checkout-journey-and-choice-eventsfrom
jaewon/fe-3118-billing-web-checkout-journey-and-choice-events-3

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part 3 of 3, on part 2. Billing web reports the choices made on the way: method_selected (rail and method kind), promo (applied, rejected, removed or expired, with prefilled, never the code) and, on the full page, pay_blocked.

Why

The funnel could show where customers drop off but not what they chose first. Method, promo and a Pay held back by a guard were visible nowhere, and the embedded checkout dropped the payment method type on the way up from the card form.

How

  • Contract. method_selected carries rail (saved, new, on_file) and an optional method_kind (card, alipay, other). promo carries result and prefilled. pay_blocked carries reason (reactivation_unconfirmed, promo_unapplied). The payload builder is split into context, preview, payment form and choice parts so it stays under the complexity gate. Its output is unchanged.
  • Method type. CheckoutPaymentForm, CheckoutSubscribeActions and CheckoutSubscribeConfirm in @comfyorg/account-ui forward the second argument that StripePaymentForm already emits, so confirm and confirmPayment carry (token, paymentMethodType). The cloud app's handler ignores the extra argument.
  • method_selected. Both checkouts report it when a Pay goes ahead, just before submitted. A new method reports the type its token was minted for, a saved method reports the type its row lists, and the method on file reports no kind because this page never learns it. Types other than card and alipay are other.
  • promo. The full page reports the promo entry's own moves: applying to applied, applying to rejected for a code the server refused, removing to idle, and applied to idle when Pay found the code lapsed. The embedded checkout reports from the apply quote: a quote that carries the code back is applied, a quote that drops it or a server code of invalid or inapplicable is rejected. Only the newest quote call reports, as for the preview. prefilled is true when the code equals the entry link's promo, ignoring case. The code text is never reported.
  • pay_blocked. The full page reports reactivation_unconfirmed when Pay is pressed over an unticked keep-subscription consent, and promo_unapplied when Pay is pressed over a code the customer typed and did not apply.

Review Focus

  • Stacked on FE-3118 feat(billing-web): report the checkout entry and quote preview in the cloud journey phases #19819 (FE-3118 parts 1 and 2, E15 to E18), which sits on FE-3140 refactor(billing): move the billing telemetry event contract to a shared package #19798 (FE-3140). The base is the part 1 branch (which already contains part 2, FE-3118 feat(billing-web): report the payment form phases, the submission and the linked operation #19821) until it merges. Review only part 3's own change, 15 files against the base: E19 to E21 and the three account-ui components that now forward the payment method type.
  • Field name: E19 sends rail as the catalog says. It is the customer's payment rail, not the server's billing_rail, which the browser never mints.
  • element_not_ready from the catalog is not in the vocabulary. Pay is disabled until the element is ready, so no press reaches the host. The embedded checkout also disables Pay under the consent and unapplied-code guards, so it reports no pay_blocked. Both are one union member away if a path appears.
  • method_selected is reported when Pay goes ahead, not when the customer switches tabs or picks a saved row, because a new method's type is only known once its token exists.
  • A promo apply that judged nothing (a network failure, an unreadable answer) reports no promo. Only the server's verdicts count, so a transient failure is not read as a refused code.
  • The embedded checkout ignores the link's promo, so its prefilled is false unless the customer types the same code.
  • Privacy: tests assert that the code text appears in no payload, for every promo result on both checkouts.
  • Touches packages/account-ui: a two-argument emit on three components and one existing test updated to the new signature. No consumer is broken.
  • Known gaps: the top-up checkout on billing web reports no journey, and the cloud app does not report method_selected or promo yet.
  • No user-visible change. Telemetry only.

AS IS / TO BE

AS IS: AS IS at b951e9f37c: 13 of 15 scenarios off contract. The 22 runs of the real embedded and full-page checkouts report the card payment up to operation_linked but no method_selected for a new card, a new Alipay account, a new sepa_debit method, a saved card or the method on file, no promo for an applied, rejected, dropped, removed or expired code, and no pay_blocked for a link-carried code that Pay applies or for a Pay over an unticked reactivation consent, while the failed promo apply, which must report nothing, and the payload scan, 174 payloads with no code text, pass; the new tests of this PR run against this commit fail, with apps/billing-web at 1167 of 1211 passing (44 failing in 3 files), account-core src/core/billing at 603 of 608 and account-ui at 227 of 228 (CheckoutSubscribeConfirm.test.ts)

TO BE: TO BE at 92c1f316b3: 15 of 15 scenarios on contract. The same 22 runs report method_selected right before submitted with rail new and method_kind card, alipay or other for sepa_debit, rail saved with method_kind card and rail on_file with no method_kind, promo with result applied, rejected, removed or expired and prefilled false for typed codes but prefilled true for the link code, including when its letter case differs, pay_blocked promo_unapplied then promo applied for a link-carried code that Pay applies, pay_blocked reactivation_unconfirmed then the Pay that goes ahead, and no promo for a failed apply, and the codes LAUNCH20, SPRING and NOPE appear in none of the 228 payloads, 2224 fields, with no email, URL, secret or server message; apps/billing-web passes 1211 of 1211, account-core src/core/billing 608 of 608 and account-ui 228 of 228

The evidence is the method_selected, promo and pay_blocked actions RUM receives for an embedded and a full-page checkout, with the promo code text absent from every payload, before (nothing) and after.

Where this sits in the plan

Linear: FE-3118, part of FE-3105. Plan, event catalog and dependency graph: action items.

Task Ticket What Status
T1 FE-3107 Decide vocabulary and dimensions done, in the SSOT
T2 FE-3108 Decide RUM application and env mapping decided
T3 FE-3109 Billing web telemetry bootstrap (RUM and PostHog) PR 19688, merged
T3+ FE-3156 Opaque RUM user id on billing web PR 19794, merged
T4, F1 FE-3106 SDK-rail ownership PR 19620, merged
T4, F2 FE-3110 Keep operation id and fields in the mapper PR 19623, merged
T4, F3 FE-3111 Stamp billing_surface and billing_client PR 19685, merged
T4, F5 FE-3112 SDK top-up terminals PR 19628, merged
T4, F6 FE-3113 Downgrade reconciliation terminal PR 19622, merged
T4, F7 FE-3114 Legacy personal-rail events, first slice PR 19627, merged
T4, F7+ FE-3131 Legacy personal-rail events, remaining slices PR 19686, merged
T4+ FE-3140 Move the billing event contract to a shared package PR 19798, in review
T5 FE-3115 Cloud entry fidelity and Datadog parity PR 19815, PR 19816, PR 19817, PR 19818, in review
T6 FE-3116 Handoff contract and event PR 19687, merged
T7 FE-3117 Billing web attempt lifecycle PR 19809, PR 19810, PR 19811, in review
T8 FE-3118 Billing web journey and choices this PR
T9 FE-3119 Payment friction events todo
T10 FE-3120 Billing web entry, session and return PR 19804, PR 19806, PR 19807, in review
T11 FE-3121 Portal events todo
T12 FE-3122 Flag coverage check todo
T13 FE-3123 PostHog rollout dashboard todo
T14 FE-3124 Datadog tiles in the Frontend RUM dashboard todo
T15 FE-3125 Verification per flow todo
T16 FE-3126 Rollout plan todo
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T8 stroke-width:3px
Loading

@coderabbitai

coderabbitai Bot commented Oct 1, 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: bcf53ded-818c-4db3-8e17-f5073c661bf8

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
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/01/2026, 10:39:42 PM UTC

Links

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🌾 Fallow: ✅ Passed

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

No new findings in the changed files.

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

Full docs: ADR-DEVEX-LINT-0015

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

📊 Browser Reports
  • chromium: View Report (✅ 2164 / ❌ 0 / ⚠️ 1 / ⏭️ 0)
  • 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.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.7 MB heap
canvas-mouse-sweep: · 59.7 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.8 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.8 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 60.7 MB heap
dom-widget-order-dense-n200-w200-i120: · 29.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 534ms TBT · 87.1 MB heap
dom-widget-order-sparse-n1000-w20-i120: · 39.8 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 225ms TBT · 99.6 MB heap
extension-clean-combined-draw: · 30.7 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 1195ms TBT · 70.9 MB heap
extension-rgthree-prototype-draw: · 30.4 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 1404ms TBT · 79.2 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 80.0 MB heap
large-graph-pan: · 59.8 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.8 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 74.1 MB heap
legacy-node-drag: · 59.7 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.0 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 81.0 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.6 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.1 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 59.7 MB heap
subgraph-transition-enter: · 52.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 130ms TBT · 105.1 MB heap
viewport-pan-sweep: · 59.9 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.4 MB heap
vue-large-graph-idle: · 33.4 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 181.2 MB heap
vue-large-graph-pan: · 25.6 avg FPS · 12.0 P5 FPS ❌ (target: ≥52) · 11ms TBT · 182.5 MB heap
vue-node-resize-workload: · 26.5 avg FPS · 13.3 P5 FPS ❌ (target: ≥52) · 0ms TBT · 196.7 MB heap
vue-zoom-out-idle: · 33.2 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 179.5 MB heap
workflow-execution: · 58.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.8 MB heap
agent-composer-empty-conversation-typing: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.2 MB heap
agent-composer-long-conversation-typing: · 55.7 avg FPS · 30.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 103.1 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 3ms
canvas-idle: layout count 0
canvas-idle: style recalc count 8
canvas-idle: task duration 443ms
canvas-idle: script duration 11ms
canvas-idle: TBT 0ms
canvas-idle: heap used 72.7 MB
canvas-idle: DOM nodes -115
canvas-idle: event listeners 0
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 16ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 66
canvas-mouse-sweep: task duration 818ms
canvas-mouse-sweep: script duration 161ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 68.8 MB
canvas-mouse-sweep: DOM nodes -126
canvas-mouse-sweep: event listeners -82
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 10ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 30
canvas-zoom-sweep: task duration 353ms
canvas-zoom-sweep: script duration 14ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 66.8 MB
canvas-zoom-sweep: DOM nodes 53
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 4ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 471ms
dom-widget-clipping: script duration 170ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 60.7 MB
dom-widget-clipping: DOM nodes -116
dom-widget-clipping: event listeners -82
dom-widget-order-dense-n200-w200-i120: avg frame time 34ms
dom-widget-order-dense-n200-w200-i120: p95 frame time 17ms
dom-widget-order-dense-n200-w200-i120: layout duration 0ms
dom-widget-order-dense-n200-w200-i120: style recalc duration 0ms
dom-widget-order-dense-n200-w200-i120: layout count 0
dom-widget-order-dense-n200-w200-i120: style recalc count 0
dom-widget-order-dense-n200-w200-i120: task duration 812ms
dom-widget-order-dense-n200-w200-i120: script duration 69ms
dom-widget-order-dense-n200-w200-i120: TBT 534ms
dom-widget-order-dense-n200-w200-i120: heap used 87.1 MB
dom-widget-order-dense-n200-w200-i120: DOM nodes 0
dom-widget-order-dense-n200-w200-i120: event listeners 0
dom-widget-order-sparse-n1000-w20-i120: avg frame time 25ms
dom-widget-order-sparse-n1000-w20-i120: p95 frame time 17ms
dom-widget-order-sparse-n1000-w20-i120: layout duration 0ms
dom-widget-order-sparse-n1000-w20-i120: style recalc duration 0ms
dom-widget-order-sparse-n1000-w20-i120: layout count 0
dom-widget-order-sparse-n1000-w20-i120: style recalc count 0
dom-widget-order-sparse-n1000-w20-i120: task duration 479ms
dom-widget-order-sparse-n1000-w20-i120: script duration 167ms
dom-widget-order-sparse-n1000-w20-i120: TBT 225ms
dom-widget-order-sparse-n1000-w20-i120: heap used 99.6 MB
dom-widget-order-sparse-n1000-w20-i120: DOM nodes 0
dom-widget-order-sparse-n1000-w20-i120: event listeners 0
extension-clean-combined-draw: avg frame time 33ms
extension-clean-combined-draw: p95 frame time 67ms
extension-clean-combined-draw: layout duration 0ms
extension-clean-combined-draw: style recalc duration 0ms
extension-clean-combined-draw: layout count 0
extension-clean-combined-draw: style recalc count 0
extension-clean-combined-draw: task duration 9712ms
extension-clean-combined-draw: script duration 7962ms
extension-clean-combined-draw: TBT 1195ms
extension-clean-combined-draw: heap used 70.9 MB
extension-clean-combined-draw: DOM nodes -157
extension-clean-combined-draw: event listeners -80
extension-rgthree-prototype-draw: avg frame time 33ms
extension-rgthree-prototype-draw: p95 frame time 67ms
extension-rgthree-prototype-draw: layout duration 0ms
extension-rgthree-prototype-draw: style recalc duration 0ms
extension-rgthree-prototype-draw: layout count 0
extension-rgthree-prototype-draw: style recalc count 1
extension-rgthree-prototype-draw: task duration 10200ms
extension-rgthree-prototype-draw: script duration 8425ms
extension-rgthree-prototype-draw: TBT 1404ms
extension-rgthree-prototype-draw: heap used 79.2 MB
extension-rgthree-prototype-draw: DOM nodes -71
extension-rgthree-prototype-draw: event listeners -39
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 4ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 10
large-graph-idle: task duration 590ms
large-graph-idle: script duration 34ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 80.0 MB
large-graph-idle: DOM nodes -164
large-graph-idle: event listeners -82
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 11ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 70
large-graph-pan: task duration 1700ms
large-graph-pan: script duration 870ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 83.8 MB
large-graph-pan: DOM nodes 0
large-graph-pan: event listeners 0
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 14ms
large-graph-zoom: style recalc duration 12ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 65
large-graph-zoom: task duration 1764ms
large-graph-zoom: script duration 821ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 74.1 MB
large-graph-zoom: DOM nodes 0
large-graph-zoom: event listeners 0
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 7ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 45
legacy-node-drag: task duration 1967ms
legacy-node-drag: script duration 995ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 65.0 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 8
minimap-idle: task duration 579ms
minimap-idle: script duration 37ms
minimap-idle: TBT 0ms
minimap-idle: heap used 81.0 MB
minimap-idle: DOM nodes -164
minimap-idle: event listeners -82
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 6ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 392ms
subgraph-dom-widget-clipping: script duration 143ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 62.6 MB
subgraph-dom-widget-clipping: DOM nodes 0
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 4ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 428ms
subgraph-idle: script duration 8ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 64.1 MB
subgraph-idle: DOM nodes -125
subgraph-idle: event listeners -105
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 18ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 765ms
subgraph-mouse-sweep: script duration 116ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 59.7 MB
subgraph-mouse-sweep: DOM nodes 0
subgraph-mouse-sweep: event listeners 0
subgraph-transition-enter: avg frame time 19ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 13ms
subgraph-transition-enter: style recalc duration 29ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 965ms
subgraph-transition-enter: script duration 31ms
subgraph-transition-enter: TBT 130ms
subgraph-transition-enter: heap used 105.1 MB
subgraph-transition-enter: DOM nodes 13747
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 35ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 5924ms
viewport-pan-sweep: script duration 2796ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 79.4 MB
viewport-pan-sweep: DOM nodes -235
viewport-pan-sweep: event listeners -121
vue-large-graph-idle: avg frame time 30ms
vue-large-graph-idle: p95 frame time 67ms
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 16756ms
vue-large-graph-idle: script duration 276ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 181.2 MB
vue-large-graph-idle: DOM nodes -3045
vue-large-graph-idle: event listeners -14915
vue-large-graph-pan: avg frame time 39ms
vue-large-graph-pan: p95 frame time 83ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 19ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 171
vue-large-graph-pan: task duration 20666ms
vue-large-graph-pan: script duration 894ms
vue-large-graph-pan: TBT 11ms
vue-large-graph-pan: heap used 182.5 MB
vue-large-graph-pan: DOM nodes -3045
vue-large-graph-pan: event listeners -14915
vue-node-resize-workload: avg frame time 38ms
vue-node-resize-workload: p95 frame time 75ms
vue-node-resize-workload: layout duration 25ms
vue-node-resize-workload: style recalc duration 82ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 6194ms
vue-node-resize-workload: script duration 109ms
vue-node-resize-workload: TBT 0ms
vue-node-resize-workload: heap used 196.7 MB
vue-node-resize-workload: DOM nodes 0
vue-node-resize-workload: event listeners 0
vue-zoom-out-idle: avg frame time 30ms
vue-zoom-out-idle: p95 frame time 67ms
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 8503ms
vue-zoom-out-idle: script duration 137ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 179.5 MB
vue-zoom-out-idle: DOM nodes -3045
vue-zoom-out-idle: event listeners -14915
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 19ms
workflow-execution: layout count 5
workflow-execution: style recalc count 22
workflow-execution: task duration 139ms
workflow-execution: script duration 16ms
workflow-execution: TBT 0ms
workflow-execution: heap used 67.8 MB
workflow-execution: DOM nodes 129
workflow-execution: event listeners 73
agent-composer-empty-conversation-typing: avg frame time 17ms
agent-composer-empty-conversation-typing: p95 frame time 17ms
agent-composer-empty-conversation-typing: layout duration 26ms
agent-composer-empty-conversation-typing: style recalc duration 103ms
agent-composer-empty-conversation-typing: layout count 76
agent-composer-empty-conversation-typing: style recalc count 78
agent-composer-empty-conversation-typing: task duration 886ms
agent-composer-empty-conversation-typing: script duration 373ms
agent-composer-empty-conversation-typing: TBT 0ms
agent-composer-empty-conversation-typing: heap used 84.2 MB
agent-composer-empty-conversation-typing: DOM nodes 76
agent-composer-empty-conversation-typing: event listeners 876
agent-composer-long-conversation-typing: avg frame time 18ms
agent-composer-long-conversation-typing: p95 frame time 33ms
agent-composer-long-conversation-typing: layout duration 29ms
agent-composer-long-conversation-typing: style recalc duration 266ms
agent-composer-long-conversation-typing: layout count 76
agent-composer-long-conversation-typing: style recalc count 78
agent-composer-long-conversation-typing: task duration 1375ms
agent-composer-long-conversation-typing: script duration 460ms
agent-composer-long-conversation-typing: TBT 0ms
agent-composer-long-conversation-typing: heap used 103.1 MB
agent-composer-long-conversation-typing: DOM nodes 76
agent-composer-long-conversation-typing: event listeners 876
Raw data
{
  "timestamp": "2026-10-01T22:51:58.676Z",
  "gitSha": "ea1779437d634da76979004c6dca647f4c869ccd",
  "branch": "jaewon/fe-3118-billing-web-checkout-journey-and-choice-events-3",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2010.7530000000224,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 3.1230000000000007,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 433.596,
      "heapDeltaBytes": 22287484,
      "heapUsedBytes": 76314824,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.081999999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2019.8939999999084,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 3.5149999999999992,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 453.065,
      "heapDeltaBytes": 22338008,
      "heapUsedBytes": 76204624,
      "domNodes": -230,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.125999999999998,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665289256198346,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1826.595999999995,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 17.266,
      "layouts": 12,
      "layoutDurationMs": 4.307999999999999,
      "taskDurationMs": 857.6740000000001,
      "heapDeltaBytes": -32562836,
      "heapUsedBytes": 70428252,
      "domNodes": -252,
      "jsHeapTotalBytes": -786432,
      "scriptDurationMs": 163.043,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.819266055045873,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1745.2739999999949,
      "styleRecalcs": 53,
      "styleRecalcDurationMs": 15.062999999999999,
      "layouts": 12,
      "layoutDurationMs": 3.9490000000000003,
      "taskDurationMs": 778.568,
      "heapDeltaBytes": 19510156,
      "heapUsedBytes": 73787884,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 158.093,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1694.0869999999677,
      "styleRecalcs": 29,
      "styleRecalcDurationMs": 9.924,
      "layouts": 6,
      "layoutDurationMs": 1.418,
      "taskDurationMs": 354.47599999999994,
      "heapDeltaBytes": 25253684,
      "heapUsedBytes": 79283484,
      "domNodes": 53,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 13.852,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1700.4099999999198,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 9.706000000000001,
      "layouts": 6,
      "layoutDurationMs": 1.2060000000000002,
      "taskDurationMs": 350.82500000000005,
      "heapDeltaBytes": -357176,
      "heapUsedBytes": 60758152,
      "domNodes": 53,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 13.301,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 720.3549999999836,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 3.322000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 475.73099999999994,
      "heapDeltaBytes": -34255988,
      "heapUsedBytes": 67940560,
      "domNodes": -232,
      "jsHeapTotalBytes": -1572864,
      "scriptDurationMs": 167.915,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665116279069775,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 682.2419999999738,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 3.9039999999999995,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 465.46600000000007,
      "heapDeltaBytes": -7645328,
      "heapUsedBytes": 59273448,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 171.478,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66585365853659,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1150.5319999999983,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 767.5289999999999,
      "heapDeltaBytes": 14393024,
      "heapUsedBytes": 91670156,
      "domNodes": 0,
      "jsHeapTotalBytes": 6717440,
      "scriptDurationMs": 64.772,
      "eventListeners": 0,
      "totalBlockingTimeMs": 515,
      "frameDurationMs": 33.82058823529413,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1187.7960000000485,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 855.553,
      "heapDeltaBytes": 11629684,
      "heapUsedBytes": 91014036,
      "domNodes": 0,
      "jsHeapTotalBytes": 6193152,
      "scriptDurationMs": 72.354,
      "eventListeners": 0,
      "totalBlockingTimeMs": 552,
      "frameDurationMs": 34.80588235294117,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 845.5820000000358,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 469.21599999999984,
      "heapDeltaBytes": 17570844,
      "heapUsedBytes": 104652852,
      "domNodes": 0,
      "jsHeapTotalBytes": 266240,
      "scriptDurationMs": 159.73000000000005,
      "eventListeners": 0,
      "totalBlockingTimeMs": 221,
      "frameDurationMs": 24.9970588235294,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 879.2300000000068,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 489.5519999999998,
      "heapDeltaBytes": 18517348,
      "heapUsedBytes": 104225420,
      "domNodes": 0,
      "jsHeapTotalBytes": 1052672,
      "scriptDurationMs": 173.89700000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 228,
      "frameDurationMs": 25.234285714285683,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 10548.573000000033,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 9622.113000000001,
      "heapDeltaBytes": -4769576,
      "heapUsedBytes": 79628404,
      "domNodes": -172,
      "jsHeapTotalBytes": -8261632,
      "scriptDurationMs": 7851.906000000001,
      "eventListeners": -86,
      "totalBlockingTimeMs": 1023,
      "frameDurationMs": 32.86448598130842,
      "p95FrameDurationMs": 66.69999999999982
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 10827.135999999995,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 9802.851999999999,
      "heapDeltaBytes": -7300532,
      "heapUsedBytes": 68995596,
      "domNodes": -142,
      "jsHeapTotalBytes": -7213056,
      "scriptDurationMs": 8072.856,
      "eventListeners": -74,
      "totalBlockingTimeMs": 1366,
      "frameDurationMs": 32.28746268656716,
      "p95FrameDurationMs": 66.69999999999982
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 10700.158999999985,
      "styleRecalcs": 2,
      "styleRecalcDurationMs": 0.5049999999999986,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 9789.466,
      "heapDeltaBytes": 7336204,
      "heapUsedBytes": 84263044,
      "domNodes": -142,
      "jsHeapTotalBytes": -5115904,
      "scriptDurationMs": 8051.671,
      "eventListeners": -78,
      "totalBlockingTimeMs": 1105,
      "frameDurationMs": 32.13093093093093,
      "p95FrameDurationMs": 66.60000000000036
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 11626.940000000104,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 10610.804000000002,
      "heapDeltaBytes": 1432520,
      "heapUsedBytes": 81928096,
      "domNodes": 0,
      "jsHeapTotalBytes": -7340032,
      "scriptDurationMs": 8798.488,
      "eventListeners": 0,
      "totalBlockingTimeMs": 1702,
      "frameDurationMs": 33.71855072463769,
      "p95FrameDurationMs": 66.69999999999982
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2020.8200000000147,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 4.459000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 566.744,
      "heapDeltaBytes": -739912,
      "heapUsedBytes": 85154204,
      "domNodes": 0,
      "jsHeapTotalBytes": -225280,
      "scriptDurationMs": 35.787,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479342,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2052.090999999905,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 3.814999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 614.2139999999999,
      "heapDeltaBytes": -40105664,
      "heapUsedBytes": 82542460,
      "domNodes": -328,
      "jsHeapTotalBytes": -2981888,
      "scriptDurationMs": 33.007,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665853658536584,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2500.4639999999654,
      "styleRecalcs": 70,
      "styleRecalcDurationMs": 11.362,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1685.296,
      "heapDeltaBytes": -267644,
      "heapUsedBytes": 86583380,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 843.985,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.777181208053694,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2640.231999999969,
      "styleRecalcs": 70,
      "styleRecalcDurationMs": 11.13,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1714.4969999999996,
      "heapDeltaBytes": 2692972,
      "heapUsedBytes": 89190696,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 896.3050000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666455696202526,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3834.811000000002,
      "styleRecalcs": 64,
      "styleRecalcDurationMs": 12.54,
      "layouts": 60,
      "layoutDurationMs": 14.806999999999999,
      "taskDurationMs": 1820.832,
      "heapDeltaBytes": -9953072,
      "heapUsedBytes": 78529056,
      "domNodes": 0,
      "jsHeapTotalBytes": 36864,
      "scriptDurationMs": 839.8399999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66608695652174,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3618.3950000000777,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 12.008999999999999,
      "layouts": 60,
      "layoutDurationMs": 13.803,
      "taskDurationMs": 1707.324,
      "heapDeltaBytes": -11382948,
      "heapUsedBytes": 76924240,
      "domNodes": 0,
      "jsHeapTotalBytes": 823296,
      "scriptDurationMs": 802.376,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665898617511527,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3163.373999999976,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 7.224000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1981.124,
      "heapDeltaBytes": 1631264,
      "heapUsedBytes": 68744168,
      "domNodes": 0,
      "jsHeapTotalBytes": 1310720,
      "scriptDurationMs": 984.265,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.754787234042556,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3112.5509999999394,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 6.321000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1953.156,
      "heapDeltaBytes": 2768948,
      "heapUsedBytes": 67474268,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 1005.3199999999999,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.756216216216213,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2013.6760000000322,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 3.466,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 561.0319999999998,
      "heapDeltaBytes": -897400,
      "heapUsedBytes": 86580632,
      "domNodes": 0,
      "jsHeapTotalBytes": 36864,
      "scriptDurationMs": 34.93600000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479342,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2057.158999999956,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 2.9840000000000004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 597.4289999999999,
      "heapDeltaBytes": -40720668,
      "heapUsedBytes": 83300772,
      "domNodes": -328,
      "jsHeapTotalBytes": -1933312,
      "scriptDurationMs": 38.120000000000005,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665853658536584,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 604.8879999999599,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 5.601000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 392.332,
      "heapDeltaBytes": -11765984,
      "heapUsedBytes": 57531948,
      "domNodes": 0,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 143.03199999999998,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.669444444444455,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 629.39300000005,
      "styleRecalcs": 48,
      "styleRecalcDurationMs": 5.926000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 390.833,
      "heapDeltaBytes": 10586984,
      "heapUsedBytes": 73687164,
      "domNodes": 0,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 142.361,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.667567567567563,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2009.6870000000422,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 4.297000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 405.03499999999997,
      "heapDeltaBytes": -3547852,
      "heapUsedBytes": 59626952,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 7.612000000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665289256198346,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2041.5930000000344,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 3.8449999999999993,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 450.932,
      "heapDeltaBytes": -28282304,
      "heapUsedBytes": 74835756,
      "domNodes": -250,
      "jsHeapTotalBytes": -2621440,
      "scriptDurationMs": 9.165,
      "eventListeners": -210,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66557377049181,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1704.0610000000243,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 17.36,
      "layouts": 16,
      "layoutDurationMs": 5.194,
      "taskDurationMs": 751.5540000000001,
      "heapDeltaBytes": -6136972,
      "heapUsedBytes": 62854332,
      "domNodes": 0,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 116.32100000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.6656862745098,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1702.7679999999918,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 18.072,
      "layouts": 16,
      "layoutDurationMs": 5.074000000000001,
      "taskDurationMs": 778.296,
      "heapDeltaBytes": -6390036,
      "heapUsedBytes": 62427688,
      "domNodes": 0,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 115.93500000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.6656862745098,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1385.3219999999737,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 29.394999999999996,
      "layouts": 5,
      "layoutDurationMs": 13.024000000000004,
      "taskDurationMs": 964.5020000000002,
      "heapDeltaBytes": 23997468,
      "heapUsedBytes": 110249752,
      "domNodes": 13747,
      "jsHeapTotalBytes": 3932160,
      "scriptDurationMs": 30.862000000000016,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 130,
      "frameDurationMs": 19.176712328767117,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8419.161999999971,
      "styleRecalcs": 249,
      "styleRecalcDurationMs": 34.388000000000005,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5815.4890000000005,
      "heapDeltaBytes": -39350416,
      "heapUsedBytes": 83353960,
      "domNodes": -328,
      "jsHeapTotalBytes": -1216512,
      "scriptDurationMs": 2673.984,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.699007936507936,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8828.940000000102,
      "styleRecalcs": 251,
      "styleRecalcDurationMs": 34.768,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 6032.078,
      "heapDeltaBytes": -2647460,
      "heapUsedBytes": 83221064,
      "domNodes": -142,
      "jsHeapTotalBytes": -9605120,
      "scriptDurationMs": 2918.346,
      "eventListeners": -78,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.69753787878788,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17616.812000000038,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16853.455,
      "heapDeltaBytes": -17904532,
      "heapUsedBytes": 190308968,
      "domNodes": -3045,
      "jsHeapTotalBytes": 7360512,
      "scriptDurationMs": 274.53700000000003,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 30.2393470790378,
      "p95FrameDurationMs": 66.59999999999854
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17483.396999999968,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16659.194999999996,
      "heapDeltaBytes": -18994848,
      "heapUsedBytes": 189626304,
      "domNodes": -3045,
      "jsHeapTotalBytes": 7884800,
      "scriptDurationMs": 277.78000000000003,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 29.63169491525424,
      "p95FrameDurationMs": 66.60000000000036
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 21226.89300000002,
      "styleRecalcs": 173,
      "styleRecalcDurationMs": 19.85300000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20779.553999999996,
      "heapDeltaBytes": -10162280,
      "heapUsedBytes": 191325264,
      "domNodes": -3045,
      "jsHeapTotalBytes": 6242304,
      "scriptDurationMs": 867.5730000000001,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 6,
      "frameDurationMs": 39.61287313432836,
      "p95FrameDurationMs": 83.30000000000109
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20973.24900000001,
      "styleRecalcs": 169,
      "styleRecalcDurationMs": 18.110000000000014,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20552.517000000003,
      "heapDeltaBytes": -8019380,
      "heapUsedBytes": 191381508,
      "domNodes": -3045,
      "jsHeapTotalBytes": 8851456,
      "scriptDurationMs": 919.947,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 15,
      "frameDurationMs": 38.65166051660517,
      "p95FrameDurationMs": 83.30000000000109
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6333.2610000000495,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 82.71999999999998,
      "layouts": 20,
      "layoutDurationMs": 26.019000000000002,
      "taskDurationMs": 6205.823,
      "heapDeltaBytes": 1089888,
      "heapUsedBytes": 201032256,
      "domNodes": 0,
      "jsHeapTotalBytes": 1048576,
      "scriptDurationMs": 110.27600000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 36.60693641618497,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6307.952,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 81.51300000000003,
      "layouts": 20,
      "layoutDurationMs": 24.097999999999995,
      "taskDurationMs": 6182.9839999999995,
      "heapDeltaBytes": -12009788,
      "heapUsedBytes": 211506836,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 107.57500000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 38.75092024539878,
      "p95FrameDurationMs": 83.29999999999927
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 8815.349999999966,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8531.118999999999,
      "heapDeltaBytes": -31118624,
      "heapUsedBytes": 180718648,
      "domNodes": -3045,
      "jsHeapTotalBytes": 10571776,
      "scriptDurationMs": 136.91200000000003,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 29.728378378378387,
      "p95FrameDurationMs": 66.59999999999854
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 8754.695999999967,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8475.011,
      "heapDeltaBytes": -28143736,
      "heapUsedBytes": 195769844,
      "domNodes": -3045,
      "jsHeapTotalBytes": 6049792,
      "scriptDurationMs": 136.751,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 30.593006993007002,
      "p95FrameDurationMs": 66.59999999999854
    },
    {
      "name": "workflow-execution",
      "durationMs": 506.33700000003046,
      "styleRecalcs": 23,
      "styleRecalcDurationMs": 22.012999999999998,
      "layouts": 6,
      "layoutDurationMs": 2.734,
      "taskDurationMs": 146.74000000000004,
      "heapDeltaBytes": 6012984,
      "heapUsedBytes": 71830200,
      "domNodes": 131,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 20.701999999999998,
      "eventListeners": 65,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.237931034482745,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "workflow-execution",
      "durationMs": 494.0189999999802,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 16.232999999999997,
      "layouts": 3,
      "layoutDurationMs": 1.6299999999999997,
      "taskDurationMs": 131.58100000000002,
      "heapDeltaBytes": 5749208,
      "heapUsedBytes": 70433028,
      "domNodes": 126,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.223000000000004,
      "eventListeners": 81,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.26071428571426,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 985.8459999999241,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 106.137,
      "layouts": 76,
      "layoutDurationMs": 27.130000000000003,
      "taskDurationMs": 952.1429999999999,
      "heapDeltaBytes": 18857820,
      "heapUsedBytes": 88090340,
      "domNodes": 76,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 400.95699999999994,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66610169491526,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 857.168999999999,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 99.943,
      "layouts": 76,
      "layoutDurationMs": 25.13,
      "taskDurationMs": 820.7520000000001,
      "heapDeltaBytes": 17514540,
      "heapUsedBytes": 88415168,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 344.068,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1404.356000000007,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 260.768,
      "layouts": 76,
      "layoutDurationMs": 29.179,
      "taskDurationMs": 1375.9730000000002,
      "heapDeltaBytes": -19579140,
      "heapUsedBytes": 107294908,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 458.184,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.94743589743589,
      "p95FrameDurationMs": 33.30000000000109
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1407.0829999999432,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 271.219,
      "layouts": 76,
      "layoutDurationMs": 28.144,
      "taskDurationMs": 1373.102,
      "heapDeltaBytes": -19325332,
      "heapUsedBytes": 108981092,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 462.128,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.931645569620258,
      "p95FrameDurationMs": 33.29999999999927
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 53474 81913 65.3% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 66.8% 1165
src/LGraphNode.ts 70.5% 387
src/platform/workspace/stores/billingOperationStore.ts 7.8% 366
src/renderer/extensions/layerEditor/composables/useLayerEditorSession.ts 40.1% 332
src/LGraph.ts 79.0% 272
src/core/billing/operationLifecycle.ts 1.1% 262
src/platform/workspace/stores/teamWorkspaceStore.ts 39.2% 258
src/scripts/app.ts 73.1% 253
src/core/webSessionIdentity.ts 3.3% 231
src/scripts/pnginfo.ts 20.7% 222

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

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

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff.

Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped.

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

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

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                                       Coverage Diff                                        @@
##           jaewon/fe-3118-billing-web-checkout-journey-and-choice-events   #19822     +/-   ##
================================================================================================
  Coverage                                                          84.73%   84.74%             
================================================================================================
  Files                                                               3416     3416             
  Lines                                                             163702   163752     +50     
  Branches                                                           42713    44659   +1946     
================================================================================================
+ Hits                                                              138716   138771     +55     
+ Misses                                                             23034    23030      -4     
+ Partials                                                            1952     1951      -1     
Flag Coverage Δ
billing-web-unit 91.52% <100.00%> (+0.16%) ⬆️
e2e 65.28% <ø> (+0.02%) ⬆️
unit 82.21% <100.00%> (+<0.01%) ⬆️
website-unit 79.78% <ø> (ø)

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

Files with missing lines Coverage Δ
apps/billing-web/src/checkout/checkoutJourney.ts 100.00% <100.00%> (ø)
apps/billing-web/src/checkout/checkoutRequest.ts 100.00% <ø> (ø)
.../billing-web/src/composables/useCheckoutJourney.ts 97.61% <100.00%> (+0.56%) ⬆️
...billing-web/src/composables/useFullPageCheckout.ts 93.85% <100.00%> (+0.20%) ⬆️
apps/billing-web/src/views/CheckoutView.vue 85.77% <100.00%> (+0.88%) ⬆️
...core/src/core/billing/telemetry/checkoutJourney.ts 70.83% <100.00%> (+17.50%) ⬆️
...nt-ui/src/billing/checkout/CheckoutPaymentForm.vue 100.00% <100.00%> (ø)
.../src/billing/checkout/CheckoutSubscribeActions.vue 88.23% <100.00%> (ø)
.../src/billing/checkout/CheckoutSubscribeConfirm.vue 100.00% <100.00%> (ø)

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Oct 1, 2026
Base automatically changed from jaewon/fe-3118-billing-web-checkout-journey-and-choice-events-2 to jaewon/fe-3118-billing-web-checkout-journey-and-choice-events October 1, 2026 22:22
dante01yoon added a commit that referenced this pull request Oct 1, 2026
…failed sign-in carries (#19806)

## Summary

Billing web reports the session journey:
`billing.web_session.signin_required`, `.established` and `.failed` (E7
to E9), once per tab entry. A failed sign-in now carries its
`SessionErrorCode`, as `error_code`, on both sign-in modes. This is the
second of three PRs for FE-3120. It builds on the entry events PR.

## Why

The shared web session (`unified_web_session`) exists to remove the
second sign-in a customer meets on billing web after signing in to the
cloud app. Nothing counts that screen, so the rollout cannot show
whether it works, and a session that fails to establish is invisible.
Today the failure code is also lost on the shared-session path: the
sign-in port answers with a boolean.

## Root cause

`SignInPort.establish` resolved a boolean. The session client knew the
refusal's code and the shared session knew the workspace error, but both
were dropped at the port, and a failure to create the shared session
never produced a code at all.

## How

- **Contract.** `webSessionEvent.ts` defines the three events as one
`WebSessionBillingEvent` with one line in the `BillingTelemetryEvent`
union. The payload allowlist gains `mode` and `origin` (`reason` was
added in the entry PR). `failed` sends the existing `SessionErrorCode`
as `error_code`, the same field the entry PR's `rejected` uses, so there
is one error field on both web events.
- **Carry the code.** `SignInPort.establish` now resolves `{ status:
'ok' } | { status: 'error', code }`. The session client port returns the
code of the failed mint. The shared session returns the workspace error
code, or, when creating the session fails, `INVALID_FIREBASE_TOKEN` for
a 401 and `TOKEN_EXCHANGE_FAILED` for anything else. The controller only
reads the status, so the sign-in page behaves as before.
- **Report from the one place that knows.** `billingWebSignInPort()` in
`billingWebAuth.ts` knows the decided mode, the live phase, whether the
customer authenticated on this page, and each attempt's result. Opening
the port reports `signin_required` from the live phase (`signed-out` is
`no_session`, `error` is `refused`, a phase still resolving reports
nothing). Each `establish` reports `established` (`origin` is
`interactive` once the customer signed in on this page, else `restored`)
or `failed` with `error_code`.
- **Once per tab.** All three go through `trackOncePerTab`. `failed` is
reported once per code, so a reload or a retry that fails the same way
adds nothing and a different failure still does.
- **User-visible behavior.** None. This is telemetry only.

## Review Focus

- Stacked on #19798
(FE-3140): the base is its branch until it merges, then the base moves
to main. Part 1 of this stack
(#19804, the entry
events) is already merged into that branch. Review only part 2's own
change, 15 files against the base. Next in this stack: the return click
(E27, #19807).
- `outcome` is `pending` on all three, for the same reason as the entry
events: client journey events never claim an operation outcome. A failed
session is `stage: failed` with `error_code`, not `outcome: failure`.
- A customer with a Cloud session reaches the sign-in page for a moment
and leaves like a restore, because the first route guard runs before the
mode is decided. That restore is what reports `established` with
`origin: restored`. `signin_required` waits for a settled `signed-out`
or `error` phase, so a restore that is still resolving is not counted as
a second sign-in.
- `signin_required` is once per tab, whichever reason comes first. A
refusal that follows an interactive sign-in is not a new sign-in screen,
so it is covered by `failed` and not by a second `signin_required`.
- `refused` and `failed` can describe one incident: a restored session
whose workspace is refused reports `signin_required` with `refused`,
then `failed` with `ACCESS_DENIED`. They answer different questions (who
was sent to sign-in, and why the session failed), so I kept both.
- The mapping for a session that cannot be created is deliberately
coarse. It mirrors the token exchange: a refused credential has its own
code and every other failure is one bucket. It feeds telemetry only. The
sign-in page still reads its failure copy from the port's `failureCode`
ref, which this PR does not change.
- `SignInPort.establish` changing from a boolean to a result touches
`unifiedBillingSession.test.ts` expectations (three assertions). There
are no other callers.
- Known gap: the second sign-in KPI only means something as
`unified_web_session` rolls out. With the flag off, every signed-out
visit is a sign-in on the session client, so the two modes are compared
through `mode` on `established`, not through `signin_required` alone.
- Existing behavior this PR makes visible: in shared-session mode, after
creating the shared session fails (for example a 503), the page's Try
again calls `establish()` with no user, which answers
`NOT_AUTHENTICATED` without any request. The telemetry therefore reports
a second `failed` with `error_code: NOT_AUTHENTICATED` for that retry,
once per code. The retry cannot succeed today; signing in again does
recreate the session. Not changed here; tracked in
[FE-3158](https://linear.app/comfyorg/issue/FE-3158).

## AS IS / TO BE

AS IS: ![AS IS at 7a373ea: 15 of 15 scenarios off contract.
billingWebSignInPort() reports no web_session event on either sign-in
mode, so a Cloud session found on arrival, a sign-in on billing web, a
refused workspace, a session the shared endpoint refuses to create with
503 or 401, a reload and a retry each reach
billingWebTelemetry.trackBillingEvent, datadogRum.addAction and
posthog.capture with only the entry link web_entry.received, and the
port establish() resolves a bare true or false that drops the failure
code, ACCESS_DENIED, TOKEN_EXCHANGE_FAILED and INVALID_FIREBASE_TOKEN
included; the 15 payloads per sink that do arrive hold only bounded
enums and a boolean; with this PR test files copied in, apps/billing-web
passes 1074 of 1084 with webSessionTelemetry.test.ts failing to load,
account-core src/core/billing 600 of
601](https://github.com/user-attachments/assets/64cb5197-1698-42c3-9279-05d67e66f642)

TO BE: ![TO BE at 8dbc5fb: 15 of 15 scenarios on contract.
billingWebSignInPort() reports billing.web_session.signin_required with
reason no_session or refused, established with origin restored or
interactive and mode session-client or web-session, and failed with
error_code, once per tab on both sign-in modes: ACCESS_DENIED for a
refused workspace, TOKEN_EXCHANGE_FAILED for a 503 and
INVALID_FIREBASE_TOKEN for a 401 whether the token mint or the shared
session creation refuses, a reload or a retry that fails the same way
adds nothing while a different code is reported once, and establish()
resolves { status: "ok" } or { status: "error", code }; the 45 payloads
per sink, 30 of them web_session events, hold only bounded enums and a
boolean, with no token, uid, email, workspace id or URL found;
apps/billing-web passes 1092 of 1092, account-core src/core/billing 601
of
601](https://github.com/user-attachments/assets/17a56676-3869-4d1d-acb0-e21ecb074994)

The evidence is the sequence of billing web telemetry events for a Cloud
session found on arrival, a signed-out visitor who signs in on billing
web, a refused workspace, and a session the shared endpoint refuses to
create (503 and 401), on both sign-in modes, before (no events, boolean
result) and after.

## Where this sits in the plan

Linear: [FE-3120](https://linear.app/comfyorg/issue/FE-3120), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](#19815), [PR
19816](#19816), [PR
19817](#19817), [PR
19818](#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](#19809), [PR
19810](#19810), [PR
19811](#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | this PR |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T10 stroke-width:3px
```
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
billing-web Ignored Ignored Oct 1, 2026 10:37pm UTC
billing-web-test Ignored Ignored Oct 1, 2026 10:37pm UTC

Request Review

dante01yoon added a commit that referenced this pull request Oct 1, 2026
…d failed (#19818)

## Summary

Report the cancel flow on the cloud app as `billing.cancel.intent`,
`billing.cancel.abandoned` and `billing.cancel.failed`, through one
surface-free contract that billing web can reuse. Part 4 of 4 for
FE-3115.

## Why

The cancel flow stages reach PostHog and the desktop sink only. Datadog
cannot show how many customers open the cancel flow, how many leave it,
or where it breaks. The cancel request itself is already reported as
`billing.operation.*` with `operation_type: cancel`.

## Root cause

The legacy `trackSubscriptionCancellation` stages (`flow_opened`,
`abandoned`, `failed`) have no typed counterpart, and the stage
`abandoned` was not part of the billing vocabulary.

## How

- **Contract.** `cancelEvent.ts` defines operation `cancel` with stages
`intent` and `failed` (the shared stage types) and the new `abandoned`
(outcome `pending`: the customer left, no operation outcome is claimed).
It carries only `current_tier` and `cycle`, both plan facts that exist
on any surface, and no surface-specific field. One union line and three
names. No new allowlist field.
- **Plan facts.** `toCurrentTier` moved from `useSubscriptionDialog` to
`billingPlanTelemetry.ts` and gained `toBillingCycle`, with a table
test. `createCancelFlowReporter` in
`subscriptionCancellationTelemetry.ts` builds the events for both flows,
so the ownership rule below lives in one place.
- **Ownership.** The reporter emits `intent` where the legacy
`flow_opened` fires. It emits `abandoned` where the legacy `abandoned`
fires, unless the customer already confirmed. When the confirmed cancel
becomes an operation (the workspace rail), its `billing.operation.*`
events own the end of the attempt, so the reporter emits no `failed`
either. `failed` is reported only for a flow that ends with no
operation: the legacy-rail dialog when its cancel fails, and a provider
failure whose native dialog cannot open (category `rendering`).
`useWorkspaceBilling.cancelSubscription` is unchanged.
- **Flows covered.** The provider (Churnkey) flow in
`launchCancellationFlow` and the native
`CancelSubscriptionDialogContent`, which also carries the attempt on
after a provider failure (`flowAlreadyOpened`).
- **Tests.** Table-driven through the real flows with the telemetry sink
recording: each row's expected cancel events are literal, and a Datadog
row shows the billing actions with `billing_surface: cloud_app`.

## Review Focus

- Stacked on #19817
(FE-3115 part 3),
#19816 (part 2) and
#19815 (part 1), on
top of #19798
(FE-3140). The base is the part 3 branch until it merges. Review only
the commits after part 3's head `5e5c09685c`. FE-3117 later reuses this
cancel contract for billing web.
- The Notion catalog lists `source` and `failure_category` as E14 key
fields. `source` is not in the event: the cloud app only ever sends
`cancel_plan_menu`, billing web has its own entry, and neither value
belongs to the one source list. Add it when billing web needs it. The
legacy `current_tier`, `cycle` and `end_date` are replaced by the
bounded `current_tier` and `cycle`; the end date and the error message
are not sent.
- `outcome` for `abandoned` is `pending`, so a dashboard that counts
`outcome: success` and `outcome: failure` is not moved by customers who
leave.
- A provider failure that falls back to the native dialog reports no
`failed`: the attempt continues in the dialog and ends there. Reporting
both would give one attempt two endings.
- A discount accepted in the provider flow ends with `intent` and no end
event. The customer kept the plan, which is neither an abandonment nor a
cancel, and the legacy event does not report it either. Say if you want
a stage for it.
- On the legacy billing rail the cancel completes in the Stripe portal,
so a flow ends in `intent` and nothing else unless the request fails.
There is no operation to wait for.
- No user-visible change: the diff adds telemetry calls, a plan helper
and a moved function. No dialog, copy or code path changes.
- FE-3117 can emit the billing web side with `CancelBillingEvent` as it
stands.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too (local Node 24 against engine 26).
This diff does not touch it.

## AS IS / TO BE

AS IS: placeholder, to be attached by editing this description.

TO BE: placeholder, to be attached by editing this description.

The evidence is the cancel events recorded while the cancel flow is
opened, abandoned, confirmed and failed, before (none) and after
(`billing.cancel.intent`, `.abandoned`, `.failed`), next to the
unchanged `billing.operation.*` events for a confirmed cancel.

## Where this sits in the plan

Linear: [FE-3115](https://linear.app/comfyorg/issue/FE-3115), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | this PR |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](#19809), [PR
19810](#19810), [PR
19811](#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806), [PR
19807](#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T5 stroke-width:3px
```
dante01yoon added a commit that referenced this pull request Oct 1, 2026
….topup.started (#19817)

## Summary

Report the amount and the preset a customer chose on
`billing.topup.started`: `amount_cents` as an integer and
`amount_preset` as one of `10`, `25`, `50`, `100` or `custom`. Part 3 of
4 for FE-3115.

## Why

Datadog receives top-up starts but not what was bought. PostHog,
Mixpanel and GTM get the amount from the legacy purchase-click event
only. Funnels by amount and by preset need the amount on the canonical
start.

## Root cause

`billing.topup.started` carried only the entry source. The dialogs know
the amount and which preset button was picked, but neither field had a
place in the billing event contract.

## How

- **Contract.** `topupEvent.ts` gains `TOPUP_AMOUNT_PRESETS_USD` (10,
25, 50, 100), the `TopupAmountPreset` type (the four values as strings,
or `custom`) and `getTopupAmountPreset`. The started stage gains
optional `amount_cents` and `amount_preset`. Both are allowlist fields,
bounded: an integer and a fixed enum, nothing free-form.
- **Emitters.** The workspace dialog and the legacy dialog report both
fields on the start event. The preset is the button the customer picked.
Any typed amount is `custom`, including a typed amount that equals a
preset. The workspace dialog computes the cents once and uses the same
value for the API call.
- **One list of presets.** Both dialogs now read the preset amounts from
`TOPUP_AMOUNT_PRESETS_USD` instead of each keeping its own `[10, 25, 50,
100]`, so the telemetry enum and the buttons cannot drift.
- **Datadog.** A test drives the real dialog through the real registry
and the Datadog provider and checks the `billing.topup.started` action
with the amount, the preset, the source and `billing_surface:
cloud_app`.

## Review Focus

- Stacked on #19816
(FE-3115 part 2, source fidelity) and
#19815 (part 1), on
top of #19798
(FE-3140). The base is the part 2 branch until it merges. Review only
the commits after part 2's head `3cfb584720`. Next: the cancel flow
(part 4).
- `amount_preset` is a string enum (`'10'`, `'25'`, `'50'`, `'100'`,
`'custom'`), not a number, so a Datadog facet has one type. The ticket
says 'the existing preset enum'; there was no enum, only the dialogs'
local arrays, so this adds the type and takes the values from the same
list the buttons use.
- A typed amount that equals a preset reports `custom`. The field says
which control the customer used, not what the amount happens to be.
`amount_cents` carries the amount either way.
- Both new fields are optional on the stage, not required, so a surface
that cannot supply them (billing web later) is not forced to invent
them. The legacy rail is covered: the legacy dialog reports them too.
- The recovered legacy top-up success (credits tile, usage table) has no
start event in that tab and still carries no amount.
- The legacy PostHog, Mixpanel and GTM purchase-click event is
untouched.
- No user-visible change: the diff adds telemetry fields and replaces
two local constants with the shared list.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too (local Node 24 against engine 26).
This diff does not touch it.

## AS IS / TO BE

AS IS: ![AS IS at 3cfb584: 16 of 16 scenarios off contract. In all 16
purchase sequences, the preselected 50 dollars, the presets 10, 25, 50
and 100, a typed 75 and a typed 100, on both the workspace and the
legacy top-up dialog, billing.topup.started reaches
datadogRum.addAction, posthog.capture and the desktop host sink with
only outcome and the source and no amount_cents or amount_preset, while
the legacy app:api_credit_topup_button_purchase_clicked already sends
credit_amount to PostHog and the desktop sink; this PR's new tests fail
as expected (8 of 19 in TopUpCreditsDialogContentLegacy.test.ts, 5 of 60
in TopUpCreditsDialogContentWorkspace.test.ts, 7 of 7 in
topupEvent.test.ts); root changed test files plus src/platform/telemetry
pass 675 of 688, account-core src/core/billing 601 of
608](https://github.com/user-attachments/assets/19f882c7-7115-4c66-b490-6978659e8875)

TO BE: ![TO BE at 5e5c096: 16 of 16 scenarios on contract.
billing.topup.started now carries amount_cents and amount_preset to
datadogRum.addAction, posthog.capture and the desktop host sink on both
dialogs: 5000 and 50 for the preselected amount, 1000 and 10, 2500 and
25, 5000 and 50, 10000 and 100 for each clicked preset, 7500 and custom
for a typed 75, and 10000 and custom for a typed 100 that equals a
preset, the Datadog action also carries billing_surface cloud_app, the
legacy purchase_clicked event is unchanged beside it and
billing.topup.failed carries no amount; the 193 billing events recorded
across 85 harness tests hold 10 allowlisted keys with amount_cents an
integer and amount_preset one of 10, 25, 50, 100 or custom, no email,
URL, secret or free-form text; root changed test files plus
src/platform/telemetry pass 688 of 688, account-core src/core/billing
608 of
608](https://github.com/user-attachments/assets/cbf0f259-c711-4689-8550-8a35eae10088)

The evidence is the `billing.topup.started` payload for the preselected
amount, a clicked preset and a typed amount, before (no amount) and
after (`amount_cents` and `amount_preset`).

## Where this sits in the plan

Linear: [FE-3115](https://linear.app/comfyorg/issue/FE-3115), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | this PR |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](#19809), [PR
19810](#19810), [PR
19811](#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806), [PR
19807](#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T5 stroke-width:3px
```
dante01yoon added a commit that referenced this pull request Oct 1, 2026
…de and recovered operations (#19816)

## Summary

Source fidelity for the cloud entries. The popover, the credits tile,
the settings panel and the deep link pass a source into the top-up
dialog. The source rides on the downgrade events, on the legacy top-up
events and on the terminals of an operation recovered after a reload.
Each source vocabulary maps into the one list, `PaymentIntentSource`.
Part 2 of 4 for FE-3115.

## Why

Five add-credits entries opened the top-up dialog with no source, so
`billing.entry.add_credits_clicked` and `billing.topup.started` could
not say where the customer came from. The downgrade events carried no
source at all. After a reload the poller and the SDK lifecycle report a
terminal for an operation they did not start, and the checkout journey
keeps only a collapsed `entry_source`, so those terminals lost the
source.

## Root cause

`showTopUpCreditsDialog()` was called without options from the popover,
the tile, the settings panel and the deep link. `useDowngradeToPersonal`
had no source parameter. The checkout journey record stored
`entry_source` (`pricing`, `settings_billing` or `agent_paywall`) and
nothing finer, and no emitter read it back for a recovered operation.

## How

- **Mapping.** `src/platform/telemetry/utils/paymentIntentSource.ts`
holds two tables. The click-time source maps to the list:
`credits_panel` and `settings_billing_panel` to
`settings_billing_panel`, `avatar_menu` to `avatar_menu_plans`,
`deep_link` and `agent_paywall` to themselves. The journey
`entry_source` maps to the list where it names a control: `deep_link`,
`settings_billing` (to `settings_billing_panel`) and `agent_paywall`.
`pricing`, `recovery`, `other` and `unknown` name no source.
`payment_intent_source` is the list itself. An `it.for` table covers all
three.
- **Entries.** The two popovers pass `avatar_menu_plans`, the credits
tile and the settings panel pass `settings_billing_panel`, the deep link
passes `deep_link`. The legacy `trackAddApiCreditButtonClicked` calls
are untouched. `dialogService` now forwards the options to both rails.
The legacy top-up dialog declares `source` and reports it on
`billing.topup.started` and `failed`.
- **Downgrade.** `DowngradeToPersonalBillingEvent` gains
`payment_intent_source`. The subscription checkout passes its source to
`showDowngradeToPersonalDialog`, which hands it to
`useDowngradeToPersonal`. All nine events of an attempt carry it (the
downgrade, the nested subscription checkout and the nested operation),
and so does the metadata the poller adopts for a payment that settles
later.
- **Recovered terminals.** The checkout journey record keeps
`payment_intent_source` next to `entry_source` (stored only; the emitted
journey events and `entry_source` do not change).
`getCheckoutJourneyPaymentIntentSource(opId)` returns it for the journey
bound to that operation, and falls back to the mapped `entry_source` for
a record written before this change. The poller reads it when it adopts
an operation with no metadata, and the SDK store attaches it to the
lifecycle events of an operation bound to a journey.

## Review Focus

- Stacked on #19815
(FE-3115 part 1, entry events), which sits on
#19798 (FE-3140). The
base is the part 1 branch until it merges. Review only the commits after
part 1's head `91a0b8118f`. Next: top-up amount (part 3), cancel flow
(part 4).
- No new source value. `recovery` is not produced: no entry creates a
recovery journey, a recovered operation is already marked `resumed:
true`, and it now carries the source of the journey it is bound to. The
journey `entry_source` is unchanged, so `deep_link` and `recovery` stay
unproduced there. An existing test pins that `deep_link` leaves the rail
default, and the decision says existing payloads do not change.
- The avatar menu's add-credits control maps to `avatar_menu_plans`, so
one value covers the whole avatar menu. `credits_panel` and
`settings_billing_panel` collapse into `settings_billing_panel`. Say if
either should keep its own value; that needs a new list entry.
- No user-visible change is intended, but one code path moves. A
customer who cannot top up but can subscribe lands on the pricing
dialog. Its `reason` was `top_up_blocked` and is now the entry's source.
Only `out_of_credits` changes the dialog copy and none of these entries
uses it. The legacy `modal_opened` event's `reason` and the `source` on
the hosted billing link change the same way for those customers.
- The out-of-credits banner is not changed. Its natural source is
`out_of_credits`, and passing that would switch on the out-of-credits
copy in the pricing fallback, a visible change. It still reports
`add_credits_clicked` with no source.
- A resumed journey keeps the source of the entry that created it. The
journey intent key does not include the source, so two entries into the
same journey report the first one on a recovered terminal.
- Known gaps: a legacy-rail hosted top-up whose success is inferred on
return (credits tile and usage table) still reports no source, because
the pending top-up marker is a bare timestamp. The SDK lifecycle's own
`started` event fires before the journey binds to the operation, so only
its terminals carry the source.
- The existing test 'withholds the surface from the legacy rail content'
is replaced: the legacy dialog now takes the source, so withholding it
is no longer the rule.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too (local Node 24 against engine 26).
This diff does not touch it.

## AS IS / TO BE

AS IS: ![AS IS at 91a0b81: 21 of 25 scenarios off contract.
billing.entry.add_credits_clicked carries no source from the 2 avatar
menu popovers, the credits tile, the settings panel and the deep link
(the agent paywall and the banner are unchanged), no
paymentIntentSource.ts exists so the click-time, journey entry_source
and payment_intent_source vocabularies have no mapping, none of the 11
events of the 3 team downgrade scenarios, none of the terminals of a
recovered poller subscription, a recovered poller top-up or a reattached
SDK top-up, and neither billing.topup.started nor failed of the legacy
dialog carries payment_intent_source, and the 5 changed entries land a
customer who cannot top up on the pricing dialog with reason
top_up_blocked, which also fills the legacy modal_opened reason and
paywall_shown payment_intent_source; this PR's new tests fail as
expected (25 failing tests in 14 files, paymentIntentSource.test.ts
fails to load); root changed test files plus src/platform/telemetry pass
1365 of 1390, account-core src/core/billing 601 of
601](https://github.com/user-attachments/assets/e07d4eee-3554-4aca-9888-32b902cf72c2)

TO BE: ![TO BE at 3cfb584: 25 of 25 scenarios on contract. The same
callers now report the source with the legacy click events unchanged
beside it: avatar_menu_plans from both popovers, settings_billing_panel
from the credits tile and the settings panel, deep_link from the deep
link, while the agent paywall (agent_paywall) and the banner (none) are
unchanged; paymentIntentSource.ts maps credits_panel to
settings_billing_panel, avatar_menu to avatar_menu_plans and
settings_billing to settings_billing_panel, keeps deep_link and
agent_paywall, omits pricing, recovery, other and unknown, and adds no
value to the 15 in the list; every event of a completed, a failed and a
pending team downgrade, the terminals of a recovered poller subscription
(upgrade_to_add_credits), a recovered poller top-up and a reattached SDK
top-up (avatar_menu_plans), and the legacy dialog billing.topup.started
and failed (deep_link) carry payment_intent_source; the one behavior
change is that the pricing dialog now opens with the entry's source as
its reason (avatar_menu_plans, settings_billing_panel or deep_link)
instead of top_up_blocked, with the legacy modal_opened reason and
paywall_shown payment_intent_source following, while the agent paywall
(out_of_credits) and the banner (top_up_blocked) stay as they were; the
519 billing events recorded across 582 harness tests hold 17 allowlisted
keys with bounded values, no email, URL, secret or free-form text; root
changed test files plus src/platform/telemetry pass 1402 of 1402,
account-core src/core/billing 601 of
601](https://github.com/user-attachments/assets/fc0bf695-40e6-414e-8cb2-15dc14cc4388)

The evidence is the `billing.entry.add_credits_clicked` and
`billing.topup.started` payloads from each entry, the nine downgrade
events with their source, and the terminal of an operation recovered
after a reload, before (no source) and after (the source of the entry).

## Where this sits in the plan

Linear: [FE-3115](https://linear.app/comfyorg/issue/FE-3115), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | this PR |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](#19809), [PR
19810](#19810), [PR
19811](#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806), [PR
19807](#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T5 stroke-width:3px
```
dante01yoon added a commit that referenced this pull request Oct 1, 2026
…usals before an operation included (#19810)

## Summary

Billing web reports the business lifecycle of a checkout attempt on both
checkouts (embedded and full page):
`billing.subscription_checkout.intent` and `.started` at the pay press,
then one `.succeeded` or `.failed`, including refusals before an
operation exists. This is the second of three stacked branches for
FE-3117 and delivers E10 and E11. It is stacked on the branch that
delivers E12.

## Why

The SDK stream only reports what happens after the server issued an
operation. A pay that is refused first (validation, a 4xx or 5xx, no
connection, an operation already pending, a stale quote) left no event
anywhere on billing web, so its attempt count, success rate and failure
mix were blank. The SSOT gives the host the business lifecycle for
exactly these attempts.

## Root cause

Billing web had no emitter on its pay path and no mapping from the SDK's
coded command results to the bounded failure vocabulary the cloud app
already uses.

## How

- **Tracker.** `createAttemptTelemetry`
(`apps/billing-web/src/telemetry/attemptTelemetry.ts`) wraps one command
call. It reports the start immediately before the command, at most one
terminal after it, and nothing for an attempt this tab did not start. A
press while an attempt is open joins it. A result that continues the
attempt leaves it open. Only the attempt that is still open can end, so
a second resolve of a joined press cannot add a second terminal.
- **Result mapping.** `outcomeOfCommandResult` reads an SDK
`SubscriptionCommandResult` into succeeded, failed or continued. A
settled operation uses its phase: succeeded, a decline
(`provider_decline` with its `decline_reason`), `poll_timeout`,
`reconciliation_needed`, `stale_operation`, each with the operation's
`billing_op_id`. A refusal before an operation exists maps through one
total table keyed by the SDK code, so a new SDK code fails to compile
until it is mapped. Server messages and server codes are never
forwarded.
- **Checkout events.** `subscriptionCheckoutTelemetry.ts` builds the
events. `checkoutAttemptOf(quote, entry)` reads tier, cycle and checkout
type from the quote the customer paid against, and the source from the
entry. Every event carries `billing_client: 'sdk'` and `checkout_ui`.
- **Wiring.** `CheckoutView.vue` (embedded) and `useFullPageCheckout.ts`
(full page) wrap their one `checkout.subscribe` call in
`attempts.run(...)`. Nothing else in either flow changed.
- **Contract.** `SubscriptionCheckoutBillingEvent` gains `checkout_ui`
(`embedded` or `full_page`) and `decline_reason` on its failed variant.
`BillingTelemetryErrorCode` gains `conflicting_payment_method`,
`invalid_request`, `operation_already_pending` and `quote_stale`.
`checkout_ui` is added to the allowlist. `SubscriptionCheckoutUi` is
exported.
- **README.** A short paragraph in the Telemetry section.

## Review Focus

- Stacked on #19809
(FE-3117 part 1, the shared mapper and E12), which sits on
#19798 (FE-3140). The
base is the part 1 branch until it merges. Review only the commits after
part 1's head `63120db378`. Next in this stack: the resubscribe
lifecycle (E13,
#19811).
- Both `intent` and `started` fire at the pay press, as the catalog says
for E10. The cloud app fires `intent` at plan select, so `intent` marks
a different step on each surface. Billing web's earlier steps (entered,
preview, method choice) belong to FE-3118.
- `REACTIVATION_CONFIRMATION_REQUIRED` keeps the attempt open and emits
no `failed`. The SSOT says it is a continuation state and must not
produce a phantom failure. The catalog's E11 list names "reactivation
not confirmed" among the refusals. I followed the SSOT, which is the
canonical page, and the cloud checkout behaves the same way. The
customer's next Pay continues the same attempt, with its duration
measured from the first press.
- A retry after a terminal starts a new attempt with its own intent and
start. A Pay pressed while an attempt is still open joins it. This
matches the SSOT rule that a retry starts a new lifecycle only after a
real terminal.
- No terminal is emitted for an attempt this tab did not start. A page
that reloads or returns from a provider page recovers the operation and
reports only the SDK stream (`billing.operation.*` with `resumed:
true`). There is no specialized terminal on a recovered poll.
- `billing_client: 'sdk'` is stamped on every billing web lifecycle
event, not left absent. Billing web has no legacy path, so the emitter
knows it. The brief says to leave it absent where the emitter does not
know its path.
- Category choices reuse the cloud's. A request with no HTTP status
reads as `network`, as the cloud does for a `WorkspaceApiError` without
a status, so `REQUEST_FAILED` and `NOT_AUTHENTICATED` without a status
are `network`. Any HTTP status, 5xx included, is `api_rejected`. A
missing payment method URL is `redirect` with
`missing_payment_method_url`, as in the cloud's downgrade. A malformed
response is `unknown` with `missing_checkout_response`, which is the
nearest allowlisted code.
- The new error codes and `checkout_ui` touch shared files (`stages.ts`,
`payload.ts`, `subscriptionCheckoutEvent.ts`, `telemetry/index.ts`).
Each addition is a separate line placed alphabetically, so a conflict
with a sibling branch should be a trivial merge.
- Known gaps. A re-quote that fails after the reactivation prompt leaves
the started attempt without a terminal. A hosted redirect, a closed tab
or a back press also leave a start without a terminal, which is the
abandoned event of FE-3119. Billing web rebuilds its return links
without `source`, so the entry source is not carried across a provider
redirect, which FE-3120 covers.
- E14 (billing web cancel intent, abandoned and failed) is not built. It
follows FE-3115, which defines the cancel event contract first. The SDK
stream already reports a cancel operation.
- Size is about 340 non-test lines, a little over the 300 target. Most
of it is the closed result-to-category table and the two event builders.
- The first fallow run flagged `failureOfRefusal` (a switch, cyclomatic
15) and `pay` in `CheckoutView.vue` (an added optional chain) as
introduced complexity. I replaced the switch with a total lookup table
and passed the entry to `checkoutAttemptOf` so `pay` gained no branch.
The audit now passes with `complexity_introduced` 0.
- No user-visible change. Billing web sends new RUM actions and PostHog
events and nothing else changes.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too under Node 24. This diff does not
touch it.

## AS IS / TO BE

AS IS: ![AS IS at bee7d5b with this PR's new tests copied in: 9 of 11
scenarios off contract. On both the embedded and the full-page checkout
a pay press that succeeds or is declined reports only the SDK stream
(billing.operation.started, then succeeded or failed), while a
validation refusal, a 503, a network failure, an operation already
pending and a stale quote report no event at all (RUM 0 calls, PostHog 0
calls), and the reactivation consent and the retry show no intent or
started either; a payment recovered on page load already reports only
the SDK stream with resumed true, and no payload holds the planted
server text; the new tests fail as expected (attemptTelemetry.test.ts
and subscriptionCheckoutTelemetry.test.ts fail to load, 8 CheckoutView
and FullPageCheckoutView tests red, 1 payload test red):
apps/billing-web passes 1058 of 1066 and account-core src/core/billing
599 of
600](https://github.com/user-attachments/assets/6f407130-897d-4755-81ca-22991f6b77d1)

TO BE: ![TO BE at 96c1f28: 11 of 11 scenarios on contract. On both
checkouts a pay press reports billing.subscription_checkout.intent and
.started before the command and then exactly one .succeeded or .failed,
with billing_client sdk, checkout_ui embedded or full_page, tier, cycle,
checkout_type and the entry source: success and decline wrap the SDK
stream and carry the same billing_op_id (the decline adds
provider_decline and decline_reason card_declined); a validation
refusal, a 503, a network failure, an operation already pending and a
stale quote end with validation and invalid_request, api_rejected,
network, operation_already_pending and quote_stale, with no operation
id; a reactivation consent demand leaves intent and started open until
the next Pay ends the same attempt, a retry after a terminal starts a
new intent and started, and a payment recovered on page load reports
only the SDK stream with resumed true; the planted server messages,
codes, email, URL and secret appear in none of 160 payloads;
apps/billing-web passes 1098 of 1098 and account-core src/core/billing
600 of
600](https://github.com/user-attachments/assets/8fbeb56d-6ef4-47c9-bb13-5a1c352f5bce)

The evidence is the RUM actions billing web sends for one checkout
attempt that succeeds, is declined, is refused before an operation
exists (validation, a server error, no connection, already pending) and
continues through the reactivation consent: before, none of them; after,
intent, started and one terminal, with the bounded failure category and
no server text.

## Where this sits in the plan

Linear: [FE-3117](https://linear.app/comfyorg/issue/FE-3117), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](#19815), [PR
19816](#19816), [PR
19817](#19817), [PR
19818](#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | this PR |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806), [PR
19807](#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T7 stroke-width:3px
```

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

Reviewed the exact head against the account-layer telemetry contract. Payment-method, promotion, and blocked-pay events avoid sensitive values, preserve tab-local workspace scope, and have settled remote coverage. Approved.

@dante01yoon
dante01yoon merged commit 72ffad4 into jaewon/fe-3118-billing-web-checkout-journey-and-choice-events Oct 1, 2026
135 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-3118-billing-web-checkout-journey-and-choice-events-3 branch October 1, 2026 23:03
dante01yoon added a commit that referenced this pull request Oct 1, 2026
#19807)

## Summary

Billing web reports a click on each way back to the host:
`billing.web_return.clicked` with `control` set to `back`, `close`,
`success_close` or `host_link` (E27). This is the last of three PRs for
FE-3120. It builds on the session events PR.

## Why

The entry and session events say how customers arrive. Nothing says how
they leave. The rollout needs to see whether customers return to the
product from a surface, a checkout step or a finished checkout, and
which of those controls they use.

## Root cause

The return controls are spread over six components and each calls its
own navigation helper. None of them reports anything.

## How

- **Contract.** `webReturnEvent.ts` defines `WebReturnBillingEvent` and
`WebReturnControl`, with one line in the `BillingTelemetryEvent` union
and `control` in the payload allowlist.
- **Reporter.** `reportReturnClicked(control)` sends the event through
the billing web facade. It is not once per tab: each click is its own
action.
- **Wiring.** `host_link` is the surface header's "Return to" link and
the sign-in page's return link for a refused workspace. `back` is the
full-page checkout's and top-up's back arrow, and the embedded
checkout's Back and confirm-step back. `close` is the embedded checkout
frame's close. `success_close` is the Close button of a finished
checkout, on the embedded success step and on the full-page ending. The
embedded `leaveForHost` takes the control; the full-page views get a
`goBack` handler, so the top-up's "View plans" keeps its own handler and
reports nothing.
- **Tests.** Each control has a click test next to the component that
owns it, plus negative rows: Try again, View plans and Add credits
report nothing, and the countdown that closes a finished checkout's tab
reports nothing.
- **User-visible behavior.** None. This is telemetry only.

## Review Focus

- Stacked on #19798
(FE-3140): the base is its branch until it merges, then the base moves
to main. Parts 1 and 2 of this stack
(#19804, the entry
events, and #19806,
the session events) are already merged into that branch. Review only
part 3's own change, 20 files against the base. The branch carries one
merge of the base and one automated formatting commit.
- The catalog lists the four `control` values without saying which
control is which. The mapping above is my reading of the six components,
so please check it. The one judgment call is that `success_close` is the
Close button of any finished checkout (success, completed, already
completed), and `close` is only the embedded frame's close.
- Only clicks are reported. The five second countdown that closes a
finished checkout's tab on its own is not a click, so most successful
script-opened tabs leave without a `web_return` event. If the rollout
wants those, it is a separate event, not `clicked`.
- "View plans" and "Add credits" on the endings send the customer to a
host page too, but they are not return controls in the catalog, so they
report nothing.
- On the embedded checkout a click that has no host destination (the
link carried no return target) reports nothing, because nothing happens.
The failure state's Back button only renders with a destination.
- `outcome` is `pending` as on the other web events. Not once per tab: a
customer who clicks Back twice, for example because the first click only
closed a tab, reports twice.
- Known gap: every one of these clicks closes or navigates the page at
once. If PostHog is not loaded yet, or RUM has not flushed, the event
can be lost with the page. Verifying flush on page exit is part of
FE-3119.
- `src/test/trackedBillingEvents.ts` is a five line helper that spies
the billing web facade for one test. The entry and session tests in the
earlier PRs inline the same four lines; I left them alone to keep those
PRs unchanged.

## AS IS / TO BE

AS IS: ![AS IS at 8dbc5fb: 12 of 15 scenarios off contract. None of
the 12 clicks that leave for the host reports billing.web_return.clicked
to datadogRum.addAction or posthog.capture, not the surface Return to
link, the sign-in return link, the embedded checkout Back on the failure
state and on the confirm step, its frame Close and its success Close,
the full-page ending Close, the ending Close in 3 finished states, the
full-page checkout and top-up back arrows, the same clicks in a tab the
product opened, or two Back clicks in one tab, while the 3 rows that
must stay silent, the countdown close, Try again with View plans and Add
credits, and a click with no host destination, are silent; with the 7
test files of this PR and its test helper copied in, apps/billing-web
passes 1089 of 1102 with 13 failing on expected an empty event list to
strictly equal the web_return event across 6 files, and account-core
src/core/billing passes 601 of 602 with the new webReturnEvent test
failing because the payload builder drops
control](https://github.com/user-attachments/assets/50f82fda-855b-4570-a126-044e1b26c4a5)

TO BE: ![TO BE at 17d2440: 15 of 15 scenarios on contract. Each click
reports one billing.web_return.clicked, identical in
datadogRum.addAction and posthog.capture, with control host_link for the
surface Return to link and the sign-in return link for a refused
workspace, back for the embedded checkout Back on the failure state and
confirm step and for the full-page checkout and top-up back arrows,
close for the embedded frame Close, and success_close for the embedded
success Close, the full-page ending Close and the ending Close in 3
finished states, two Back clicks in one tab report twice, and the same
clicks in a tab the product opened still report; payloads hold only
operation, stage, outcome, control and billing_surface billing_web with
control in the 4-value enum and no URL, id or token, and the countdown
close, Try again, View plans, Add credits and a click with no host
destination report nothing; apps/billing-web passes 1102 of 1102 and
account-core src/core/billing 602 of 602 with the new webReturnEvent
test
passing](https://github.com/user-attachments/assets/ac5702c1-0650-4e1c-954b-174bcb9284d1)

The evidence is the `billing.web_return.clicked` payload for each
control, from the surface link, the embedded checkout's Back, Close and
success Close, and the full-page back arrow and Close, plus the absence
of an event for the countdown close, before (no events) and after.

## Where this sits in the plan

Linear: [FE-3120](https://linear.app/comfyorg/issue/FE-3120), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](#19815), [PR
19816](#19816), [PR
19817](#19817), [PR
19818](#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](#19809), [PR
19810](#19810), [PR
19811](#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | this PR |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T10 stroke-width:3px
```

---------

Co-authored-by: GitHub Action <action@github.com>
dante01yoon added a commit that referenced this pull request Oct 2, 2026
…rom billing web (#19809)

## Summary

Move the SDK-to-event mapper `toBillingTelemetryEvent` into
`@comfyorg/account-core/billing` so both hosts use one mapper, keep the
cloud app on it, and pass `onTelemetry` from billing web so the SDK
operation stream (`billing.operation.*`) reaches RUM and PostHog. This
is the first of three stacked branches for FE-3117; it delivers E12.

## Why

Billing web builds the same operation lifecycle as the cloud app but
passed no `onTelemetry`, so it reported no operation, success or failure
at all. The mapper that turns the SDK's lifecycle event into the typed
`billing.operation.*` event lived in a cloud-only file that billing web
cannot import.

## Root cause

`toBillingTelemetryEvent` lived in
`src/platform/workspace/billing/sdk/billingSdkTelemetry.ts`, and
`composeBillingWebClient` never set `onTelemetry` on
`createBillingOperationLifecycle`.

## How

- **Mapper.** `toBillingTelemetryEvent` moved with `git mv` to
`packages/account-core/src/core/billing/telemetry/operationLifecycleEvent.ts`
and its test next to it. The function body is unchanged; only the
imports changed. It still stamps `billing_client: 'sdk'` and still maps
a timeout to `poll_timeout` and a failure without a category to
`provider_decline`. It is exported from the `telemetry/index.ts` barrel,
so it is available from `@comfyorg/account-core/billing`.
- **Cloud.** `billingSdkStore.ts` and `billingTelemetryEvent.test.ts`
import it from the package. The cloud file and its test are deleted and
nothing re-exports it. The cloud's forwarding rules in
`billingSdkStore.reportTelemetry` are untouched, so cloud payloads are
identical.
- **Billing web.** `composeBillingWebClient` passes `onTelemetry` that
sends `toBillingTelemetryEvent(event)` through
`billingWebTelemetry.trackBillingEvent`. Both client constructors
(`createBillingWebClient`, `createWebSessionBillingClient`) go through
it, so it covers the session-token path and the web-session path.
- **Test.** The red commit (`8ed3746e49`) drives a real lifecycle over a
stubbed network and expects the RUM actions. It failed with no events
sent. The green commit pins the presentation to `hosted` (the first
draft guessed `embedded`) and tables a success, a decline with its bank
reason, and an operation parked for reconciliation.
- **README.** One short subsection under Telemetry.

## Review Focus

- Stacked on #19798
(FE-3140): the base is its branch until it merges, then the base moves
to main. This PR now carries two parts of FE-3117: its own (the shared
mapper and E12) and part 2
(#19810, E10 and E11,
the checkout attempt lifecycle), which was merged into this branch. Next
in this stack: the resubscribe lifecycle (E13,
#19811). It is a
sibling of the FE-3120, FE-3115 and FE-3118 stacks, which also sit on
FE-3140.
- Billing web is the only emitter of `billing.operation.*` on its
surface, because no billing web caller emits it. So there is no
duplicate-start guard like the cloud's `callerStarted` window. The cloud
needs that guard because its callers also announce a start; billing web
has none. FE-3117's later branches emit only
`billing.subscription_checkout.*` and `billing.resubscribe.*` from the
caller, never `billing.operation.*`.
- Everything the lifecycle reports is forwarded, top-ups included. The
cloud drops a non-resumed top-up because its dialog reports the top-up
itself. Billing web has no top-up emitter, so a top-up there is visible
only on the operation stream. A `billing.topup.*` business lifecycle for
billing web is not in E10 to E14 and is not built here.
- A refusal before the server issues an operation (validation, 4xx, 5xx,
network, already pending) has no operation, so it is still invisible
after this branch. The next branch (E10, E11) covers it.
- `billing_client: 'sdk'` and `billing_surface: 'billing_web'` come from
the mapper and the facade. No call site sets either.
- E14 (billing web cancel intent, abandoned and failed) is not built in
this stack. It follows FE-3115, which defines the cancel event contract
first. A cancel on billing web already reports its operation on this
stream.
- The mapper test moved with the code, so the cloud mapper coverage did
not shrink. The cloud's `billingTelemetryEvent.test.ts` still builds its
fixtures through the shared mapper.
- No user-visible change. Billing web sends new RUM actions and PostHog
events and nothing else changes.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too under Node 24. This diff does not
touch it. `src/stores/executionStore.test.ts` timed out once in a loaded
full run and passed alone.
- Merged with the FE-3140 branch after FE-3120's return events landed
there (`18d7292b56`): two of its tests, one in `CheckoutView.test.ts`
and one in `FullPageCheckoutView.test.ts`, asserted that the only event
sent was `billing.web_return.clicked`. Those flows now also emit this
PR's checkout attempt events, so both assertions look at the
`web_return` events only. No production code changed in that commit.

## AS IS / TO BE

AS IS: ![AS IS at c24ff3d: 7 of 9 scenarios off contract. Billing web
passes no onTelemetry to createBillingOperationLifecycle, so the real
SDK lifecycle emits started and a terminal for a subscribe success, a
decline, a reconciliation park, a poll timeout, a recovered operation
after a reload, a cancel and a top-up, and billing web reports none of
them (RUM addAction 0 calls and PostHog capture 0 calls in each of the
7); toBillingTelemetryEvent still sits in the cloud-only
src/platform/workspace/billing/sdk/billingSdkTelemetry.ts and maps the
14 scenario events and a 1728-event matrix to the reference sha256
108dfe37975e and 433dbdb50f7b; this PR's new tests fail as expected (3
billingWebClient tests red, operationLifecycleEvent.test.ts and
billingTelemetryEvent.test.ts fail to load); apps/billing-web passes
1055 of 1058, account-core src/core/billing 594 of 594 with 1 file
failing to load, root src/platform/telemetry and
src/platform/workspace/billing 842 of 842 with 1 file failing to
load](https://github.com/user-attachments/assets/cbcb3635-240e-49a3-957c-1438269acb68)

TO BE: ![TO BE at bee7d5b: 9 of 9 scenarios on contract. Billing web
now passes onTelemetry, so each of the 7 real SDK scenarios reaches RUM
addAction and PostHog capture as the same two billing.operation events
(started, then succeeded, failed or timeout) with billing_client sdk,
billing_surface billing_web, operation_type subscription, cancel or
topup, billing_op_id, presentation, resumed true after the reload, and
failure_category and decline_reason on the terminal, while no payload
holds the planted server message, email, URL or secret;
toBillingTelemetryEvent now lives in @comfyorg/account-core/billing and
maps the same 14 scenario events and the same 1728-event matrix to the
same sha256 108dfe37975e and 433dbdb50f7b as at c24ff3d, with the
cloud payload hashes b420784b31a1 and 7ae7a3461923 and the matrix output
files byte-identical; apps/billing-web passes 1058 of 1058, account-core
src/core/billing 599 of 599, root src/platform/telemetry and
src/platform/workspace/billing 852 of
852](https://github.com/user-attachments/assets/5341f44c-6ed1-4d7e-b2a9-c504f5be1485)

The evidence is the RUM action and PostHog capture names and payloads
billing web sends when the SDK lifecycle issues and settles an
operation: before, none; after, `billing.operation.started` and the
terminal with `billing_client: 'sdk'` and `billing_surface:
'billing_web'`.

## Where this sits in the plan

Linear: [FE-3117](https://linear.app/comfyorg/issue/FE-3117), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](#19798), in
review |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](#19815), [PR
19816](#19816), [PR
19817](#19817), [PR
19818](#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | this PR |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819), [PR
19821](#19821), [PR
19822](#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806), [PR
19807](#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T7 stroke-width:3px
```
laurigates pushed a commit to laurigates/ComfyUI_frontend that referenced this pull request Oct 2, 2026
…to a shared package (Comfy-Org#19798)

## Summary

Move the typed billing event contract out of the cloud app into
`@comfyorg/account-core/billing`, keep the cloud app on it, and make the
billing web facade take a typed `BillingTelemetryEvent` instead of an
event name plus a raw payload.

## Why

Billing web could not import `BillingTelemetryEvent`, the payload
allowlist or the payload builders because
`src/platform/telemetry/types.ts` imports cloud-only types. Its facade
took a name and a payload the caller had to build correctly, so every
billing web event (FE-3117, FE-3118, FE-3120, FE-3121) would have
skipped the compile-time allowlist and the privacy contract check.

## Root cause

The contract lived in a cloud file that imports `TierKey` and
`BillingCycle` from cloud subscription modules, so no other host could
reach it.

## How

- **Commit 1, the move.** The event types, stage building blocks,
allowlist `BILLING_PAYLOAD_FIELD_HANDLING`, payload builders and the
billing event-name constants moved to
`packages/account-core/src/core/billing/telemetry/`, one module per
operation plus `stages.ts`, `billingTelemetryEvent.ts` (the one union),
`payload.ts` (the one table) and `eventNames.ts`. The code is
content-identical to what was in `types.ts` (`git diff
--color-moved=dimmed-zebra` shows it as moved). `types.ts` re-exported
the names so the cloud app compiled.
- **Commit 2, the journey.** The `billing.checkout.*` journey contract
moved the same way. It is not in the ticket text. It shares its failure
vocabulary with the union and FE-3118 needs it on billing web. It is its
own commit so it can be dropped.
- **Commit 3, the cloud imports.** 24 cloud files (16 source, 8 tests)
now import from `@comfyorg/account-core/billing` and the re-exports are
deleted. No re-export is left behind. `TelemetryEvents` spreads the
shared `BILLING_TELEMETRY_EVENTS`, so its keys and values are unchanged.
- **Commit 4, the builder and the guards.**
`getBillingWebTelemetryEventPayload` builds the allowlisted payload and
stamps `billing_surface: 'billing_web'`, mirroring
`getCloudAppBillingTelemetryEventPayload`. The table is checked against
the exported `BillingPayloadFieldHandling` type, and a test proves a
table that misses an event field does not compile.
- **Commit 5, the facade.** `trackBillingEvent(event:
BillingTelemetryEvent)` derives the name with
`getBillingTelemetryEventName`, builds the payload with the billing web
builder and sends it to RUM and PostHog as before. The whole call stays
inside `attempt`, so it never throws, and telemetry-off still drops
events.
- **Commit 6, one line.** `TelemetryEventName` now includes
`BillingTelemetryEventName`. Without it, every new member of the union
failed the cloud typecheck at `PostHogTelemetryProvider` and
`HostTelemetrySink` until someone added a `TelemetryEvents` constant
(FE-3116 had to). I checked this with a throwaway `web_entry` event: it
failed before and compiled after.
- **Cloud-only types.** The contract imported `TierKey`, `BillingCycle`,
`BillingSource`, `BillingIntent`, `BillingDeclineReason`,
`BillingPresentation`, `SubscribeResponse` and `CreateTopupResponse`.
`AgentRunMode` and `AppMode` are not used by it. `BillingDeclineReason`,
`BillingPresentation` and the two response types are already in the
shared packages. `TierKey` and `BillingCycle` had no shared source, so
account-core now owns `BillingTierKey` and `BillingCycle` and the cloud
`TierKey` and `BillingCycle` are aliases of them. Nothing was widened
and every payload type is identical.
- **Mirrored vocabulary.** `PaymentIntentSource` (15 values) and
`HostedBillingIntent` (7 values) in account-core mirror `BillingSource`
and `BillingIntent` in `@comfyorg/billing-contract`. account-core cannot
depend on billing-contract: its publish-boundary test forbids
unpublished workspace dependencies and billing-contract already
dev-depends on account-core.
`packages/billing-contract/src/eventVocabulary.test.ts` fails typecheck
when the two lists drift. I confirmed it by adding a value.
- **Renames forced by the move.** The shared barrel already exports
`BillingFailure` and `BillingErrorCode` for the transport, so the
telemetry ones are `BillingTelemetryFailure`,
`BillingTelemetryFailureCategory` and `BillingTelemetryErrorCode`.
`ResubscribeClickMetadata['source']` became `ResubscribeSource`.
- **Adding an operation (for FE-3117, FE-3118, FE-3120, FE-3115).** Add
`<operation>Event.ts` next to the others, add one line to the
`BillingTelemetryEvent` union in `billingTelemetryEvent.ts`, and add any
new payload field to `BILLING_PAYLOAD_FIELD_HANDLING` in `payload.ts`
(it fails to compile until you do). Billing web calls
`billingWebTelemetry.trackBillingEvent(event)`. The cloud sinks need no
change.

## Review Focus

- The diff is large because about 500 lines are moved code. New code is
the per-module import headers, `vocabulary.ts`, the barrel `index.ts`,
one 10-line builder, the facade and the tests. The moved blocks differ
from the originals only in the renames above and the allowlist guard
type.
- Package placement. D4 names `@comfyorg/account-core/billing`, and the
SDK-to-event mapper FE-3117 moves there needs the contract in the same
package. The cost is the mirrored `PaymentIntentSource` and
`HostedBillingIntent` lists, guarded by a type test in billing-contract.
The alternative, putting the contract in billing-contract, would make
billing-contract depend on account-core at runtime and put the mapper in
the wrong package.
- The checkout journey is in this PR although the ticket does not list
it. Drop commit `be72e3ef80` and the matching part of commit 3 if you
want it separate. FE-3118 would then have to move it.
- `PaymentIntentSource = BillingSource` stays in
`src/platform/telemetry/types.ts` for its 20 cloud call sites. The
`toBillingTelemetryEvent` mapper stays in `billingSdkTelemetry.ts` for
FE-3117 to move.
- No user-visible change. Cloud payloads are byte-identical (the
existing provider and contract suites pass with import-path edits only).
Billing web has no caller of `trackBillingEvent` yet, so nothing new is
sent from it.
- The facade now drops any field outside the allowlist, so a billing web
caller that passed an extra field before would lose it. There is no such
caller today.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too (`INTERNAL ASSERTION FAILED: Expected
a class definition`, local Node 24 against engine 26). I re-ran it
against `main`'s versions of every file this PR touches and it fails the
same way. This diff does not touch it.
- Known gap: `subscriptionCheckoutTracker.ts` still keeps its own copy
of the source list, as noted in FE-3116.

## AS IS / TO BE

AS IS: ![AS IS at 8757cd8: 6 of 15 scenarios off contract.
trackBillingEvent with a name and a raw payload forwards whatever the
caller passed, so an email, a client_secret, a return_url carrying its
payment_intent_client_secret query and a free-form error_message each
reach both datadogRum.addAction and posthog.capture next to the
allowlisted fields and billing_surface billing_web, PostHog before_send
then removes only the email and the URL query while RUM beforeSend
leaves the action context alone, and billing web typecheck accepts all
four calls with 0 diagnostics; allowlisted events, a caller-claimed
billing_surface and the 7 cloud sink payloads are on contract;
apps/billing-web src/telemetry passes 49 of 49, account-core
src/core/billing 588 of 588 with no telemetry folder yet, root
src/platform/telemetry 597 of
597](https://github.com/user-attachments/assets/1ac3e87b-beee-4cd4-98ca-ee2d6b670d50)

TO BE: ![TO BE at c24ff3d: 15 of 15 scenarios on contract.
trackBillingEvent with a typed event builds the payload through
getBillingWebTelemetryEventPayload, so the same email, client_secret,
return_url and error_message, passed past the compiler with a cast,
never reach datadogRum.addAction or posthog.capture, which receive only
the 11 allowlisted fields plus billing_surface billing_web, and billing
web typecheck refuses each of the four fields with TS2353 on a throwaway
call; the 7 cloud sink events, 6 billing and 1 checkout journey through
PostHogTelemetryProvider and DatadogRumTelemetryProvider, emit the same
sha256 as at 8757cd8; apps/billing-web src/telemetry passes 53 of 53,
account-core src/core/billing 594 of 594 with 6 of 6 in the new
telemetry folder, root src/platform/telemetry 597 of
597](https://github.com/user-attachments/assets/a321d086-a0db-44c7-8f92-385a9a0cdd31)

The evidence is the RUM action and PostHog capture payload billing web
sends for a typed event that also carries an email, a client secret and
a return URL: before, whatever the caller passed plus `billing_surface`;
after, only the allowlisted fields plus `billing_surface:
'billing_web'`.

## Where this sits in the plan

Linear: [FE-3140](https://linear.app/comfyorg/issue/FE-3140), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](Comfy-Org#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](Comfy-Org#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](Comfy-Org#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](Comfy-Org#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](Comfy-Org#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](Comfy-Org#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](Comfy-Org#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](Comfy-Org#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](Comfy-Org#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
this PR |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](Comfy-Org#19815), [PR
19816](Comfy-Org#19816), [PR
19817](Comfy-Org#19817), [PR
19818](Comfy-Org#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](Comfy-Org#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | [PR
19809](Comfy-Org#19809), [PR
19810](Comfy-Org#19810), [PR
19811](Comfy-Org#19811), in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819), [PR
19821](Comfy-Org#19821), [PR
19822](Comfy-Org#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](Comfy-Org#19804), [PR
19806](Comfy-Org#19806), [PR
19807](Comfy-Org#19807), in
review |
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style C140 stroke-width:3px
```

---------

Co-authored-by: GitHub Action <action@github.com>
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…w in the cloud journey phases (Comfy-Org#19819)

## Summary

Part 1 of 3. Both billing web checkouts report the first two steps of
the checkout journey in the cloud app's phases:
`billing.checkout.entered`, then `preview_ready` or `preview_failed`.
Every event carries `billing_surface: 'billing_web'` and a `ui_mode` of
`embedded` or `full_page`.

## Why

Billing web sends no checkout funnel today. The cloud app and billing
web cannot be compared per surface, and the rollout cannot see how many
customers open the billing web checkout or how many get a quote. This
part adds the same entry and quote steps on both billing web checkouts,
including the quotes and capability reads that refuse a customer.

## Root cause

The `billing.checkout.<phase>` journey exists only in the cloud app's
emitters. The shared contract has no `full_page` UI mode and no bounded
way to say that a capability, a plan or a quote was refused. The billing
web facade only accepts `BillingTelemetryEvent`.

## How

- **Contract.** In `@comfyorg/account-core/billing`, `CheckoutUiMode`
gains `full_page`. `entered` carries an optional
`payment_intent_source`. `preview_failed` gains a bounded
`denial_reason` (the capability denial) and two checkout codes for
`error_code`, `quote_not_allowed` and `plan_unavailable`. The payload
builder forwards them. The cloud app's persisted-journey allowlist
accepts `full_page` (one line).
- **Facade.** `billingWebTelemetry.trackCheckoutJourneyEvent` sends a
journey phase to RUM and PostHog under its wire name, stamped
`billing_surface: 'billing_web'`. `trackBillingEvent` now shares the
same send path and behaves as before. The journey payload comes from the
contract's explicit builder, so no other field can pass.
- **Journey.** `useCheckoutJourney(uiMode)` owns the identity. The
journey id is the entry link's `correlation_id` and a fresh id only for
a link that carries none. `payment_intent_source` on `entered` is the
link's `source`. `entry_source` maps the link's source into the cloud's
coarse enum. `entry_flow` is the first quote's transition
(`initial_subscription` or `paid_upgrade`) and reads `unknown` on
`entered`. `assignment_status` is `unavailable`.
- **Embedded checkout.** `entered` fires at setup. Each plain quote
reports through `quotePlan`: an allowed quote is `preview_ready`, a
refused quote is `preview_failed` with `quote_not_allowed`, a failed
read is `preview_failed` with a category. Only the newest quote call
reports, so an answer the quote composable abandoned for a newer one
reports nothing.
- **Full-page checkout.** Every page event passes through one observer.
`quoted` is `preview_ready`. A refused capability, an unreadable
capability read, an unreadable quote, a refused quote and an unavailable
plan are `preview_failed`. `unavailable` and `capabilitiesFailed` events
now carry the HTTP status when the server answered.
- **Categories.** `REQUEST_FAILED` is `network` without an HTTP status
and `api_rejected` with one. `NOT_AUTHENTICATED`, `ACCESS_DENIED`,
`NOT_FOUND`, `CONFLICT`, `OPERATION_ALREADY_PENDING` and
`NO_ACTIVE_SUBSCRIPTION` are `api_rejected`. `INVALID_REQUEST` is
`validation`. Anything else is `unknown`.
- **Once per revision.** `preview_ready` fires once per accepted quote
revision (`quote_id:quote_version`), as in the cloud app.

## Review Focus

- FE-3140 (Comfy-Org#19798) is
merged into main (`a8337f39a4`); the base of this PR is main. This PR
carries all three parts of FE-3118: its own (E15 and E16, the entry and
the quote preview), part 2
(Comfy-Org#19821, E17 and E18)
and part 3 (Comfy-Org#19822,
E19 to E21 and the three account-ui components that forward the payment
method type), which were merged into this branch. It is a sibling of the
FE-3117 part 3
(Comfy-Org#19811) and FE-3115
(Comfy-Org#19815) PRs.
- `entry_source` vocabulary: billing web maps the link's 15 sources into
the cloud's coarse 7-value `entry_source` enum. `agent_paywall`,
`deep_link` and `settings_billing_panel` (as `settings_billing`) keep a
name, any other source is `other`, no source is `unknown`.
`payment_intent_source` on `entered` carries the full source, and it is
the field to split by. The cloud reports `pricing` for most
pricing-dialog entries, so cloud and billing web `entry_source` do not
match for the same journey until FE-3115 unifies the source
vocabularies. Widening `CheckoutEntrySource` here instead would break
the cloud's `satisfies Record` allowlist and collide with FE-3115.
- `entry_flow` is `unknown` on `entered`, because the flow is the
quote's and nothing is quoted yet. Join on `checkout_journey_id` to read
the flow of an entry.
- Journey identity is fixed when the view sets up. A reload sends
`entered` again under the same journey id, so count distinct journey
ids. A link change inside a reused checkout view keeps the first id. A
journey id minted for a link without `correlation_id` uses
`crypto.randomUUID()`, which the SDK already requires for its
idempotency keys.
- Likely overlap: the one-line `UI_MODES` change in
`src/platform/workspace/utils/checkoutJourney.ts` sits near the
entry-source work in FE-3115. A code-to-category mapper like
`failureCategoryOf` may also appear in FE-3117 for subscribe failures.
- `checkoutPage.ts` changes only two event types, which gain an optional
`httpStatus`. The reducer is untouched.
- The facade change is small but touches `trackBillingEvent`: its body
now calls the shared `send`. Its existing tests pass unchanged.
- Known gaps: the top-up checkout on billing web reports no journey.
Quotes the promo field requests are left to part 3.
- No user-visible change. Telemetry only.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too under Node 24. The timing-based tests
in `router.planless.test.ts`, `billingWebAuth.*` and
`operationLifecycle.test.ts` can time out on a loaded machine and pass
alone.
- Merged with the FE-3140 branch after FE-3117 landed there
(`0de5cf4218`). One conflict, in `CheckoutView.vue` `pay()`: the journey
hooks (`method_selected`, `submitted`) now run first and FE-3117's
attempt tracker wraps the `checkout.subscribe` call unchanged.
`CheckoutView.streams.test.ts` runs the embedded checkout over the real
SDK client with only the network and the RUM sink mocked and pins the
order of a successful Pay across the three families: `entered`,
`preview_ready`, `method_selected`, `submitted`, then
`subscription_checkout.intent` and `.started`,
`billing.operation.started`, `operation_linked`,
`billing.operation.succeeded` and `subscription_checkout.succeeded`,
with the four events after the issue sharing one `billing_op_id`.
- Review fixes after CodeRabbit (`192c751f28`, red tests first): a Pay
refused with `OPERATION_ALREADY_PENDING` or `CONFLICT`, or whose command
rejects, no longer lets a later recovered operation be reported as
`operation_linked` (the journey's wait is cleared per press when its
command settles, in both Pay handlers); `preview_failed` takes its
`failure_category` from the attempt's mapper, so one refusal has one
category in the journey and the attempt funnels (`NOT_AUTHENTICATED`
without a status is `network` in both); and the negative tests wait on
positive signals instead of a timer.

## AS IS / TO BE

AS IS: ![AS IS at ce06a6f: 0 of 18 scenarios on contract. Across 63
runs of the real embedded checkout CheckoutView and full-page checkout
FullPageCheckoutView, billing web telemetry receives no checkout journey
event, with RUM addAction 0 calls and PostHog capture 0 calls, for a
quote that loads, a refused quote, a quote read that fails as no answer,
HTTP 503, ACCESS_DENIED, INVALID_REQUEST or MALFORMED_RESPONSE, a
capability denied for each of 7 reasons, a capability read that fails, a
retired plan, a team plan without its stop, a link with and without a
source and a journey id, each of the 15 link sources, and an abandoned
quote; the new tests of this PR run against this commit fail, with
apps/billing-web at 1093 of 1111 passing (18 failing in 3 files,
checkoutJourney.test.ts fails to load) and account-core src/core/billing
at 601 of
603](https://github.com/user-attachments/assets/967f5a49-5411-40d8-a39f-184bd4697e07)

TO BE: ![TO BE at f34408a: 18 of 18 scenarios on contract. The same
63 runs send billing.checkout.entered and then preview_ready or
preview_failed to RUM and PostHog with identical payloads, 250 payloads
and 2460 fields all inside the contract vocabulary: ui_mode embedded or
full_page, billing_surface billing_web, one journey id per run taken
from the link correlation_id or a fresh uuid, entry_source
agent_paywall, deep_link or settings_billing for those 3 of the 15 link
sources with other for the rest and unknown for no source or an unlisted
one while payment_intent_source carries the full source, preview_failed
with failure_category network, api_rejected, validation or unknown by
the read that failed, quote_not_allowed, plan_unavailable for a retired
plan and for a team plan without its stop, and the bounded denial_reason
for all 7 denials; an abandoned quote that answers REQUEST_FAILED after
the checkout moved on, and one that answers SUPERSEDED, report no
preview_failed, and no email, URL, secret or server message planted in
the stubbed answers reaches any payload; apps/billing-web passes 1147 of
1147 and account-core src/core/billing 603 of
603](https://github.com/user-attachments/assets/31b3c5a3-6e40-439e-9139-82bf45db53e0)

The evidence is the `billing.checkout.*` actions RUM receives for an
embedded and a full-page checkout (a quote that loads, a refused quote
and a denied capability), which are absent before and present after.

## Where this sits in the plan

Linear: [FE-3118](https://linear.app/comfyorg/issue/FE-3118), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](Comfy-Org#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](Comfy-Org#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](Comfy-Org#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](Comfy-Org#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](Comfy-Org#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](Comfy-Org#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](Comfy-Org#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](Comfy-Org#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](Comfy-Org#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](Comfy-Org#19798),
merged |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](Comfy-Org#19815), [PR
19816](Comfy-Org#19816), [PR
19817](Comfy-Org#19817), [PR
19818](Comfy-Org#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](Comfy-Org#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | parts 1 and 2 merged
([PR 19809](Comfy-Org#19809),
[PR 19810](Comfy-Org#19810), in
[PR 19798](Comfy-Org#19798)),
[PR 19811](Comfy-Org#19811) in
review |
| T8 | FE-3118 | Billing web journey and choices | this PR |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](Comfy-Org#19804), [PR
19806](Comfy-Org#19806) and [PR
19807](Comfy-Org#19807), merged
in [PR 19798](Comfy-Org#19798)
|
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T8 stroke-width:3px
```

---------

Co-authored-by: GitHub Action <action@github.com>
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…g#19811)

## Summary

Billing web reports the resubscribe lifecycle from the subscription
screen: `billing.resubscribe.started` before the request and one
`billing.resubscribe.succeeded` or `.failed`, with `source:
'billing_web_subscription'`. This is the third of three stacked branches
for FE-3117 and delivers E13. It reuses the attempt tracker from the
branch that delivers E10 and E11.

## Why

The SDK reports a resubscribe as a plain `subscription` operation, so
the operation stream cannot tell a resubscribe from a new subscription
or a plan change. The cloud app reports `billing.resubscribe.*` from its
callers. Billing web reported nothing, so a resubscribe, a plan that was
already active and a refusal before any operation were all invisible.

## Root cause

The resubscribe button on billing web called `checkout.resubscribe()`
with no emitter, and the `resubscribe` event type had no operation id,
no duration and no billing web source.

## How

- **Events.** `resubscribeTelemetry.ts` builds the events on the same
`createAttemptTelemetry` and result mapping as the checkout. The start
is reported immediately before `checkout.resubscribe()`. The terminal
carries `billing_op_id` once one exists, `duration_ms`, and for a
decline its `decline_reason`. A plan that was already active (the SDK's
already-held answer, which issues nothing) counts as succeeded and has
no operation id. `payment_intent_source` is the entry source when the
customer arrived with one.
- **Wiring.** `SubscriptionActions.vue` wraps its one
`checkout.resubscribe()` call. Cancel is unchanged.
- **Contract.** `ResubscribeBillingEvent` gains `billing_op_id`,
`duration_ms` and `decline_reason` on its failed variant, all optional,
so the cloud's events are unchanged. `ResubscribeSource` gains
`billing_web_subscription`.
- **README.** A short paragraph in the Telemetry section.

## Review Focus

- FE-3140 (Comfy-Org#19798) is
merged into main (`a8337f39a4`), and with it FE-3120's three parts
(Comfy-Org#19804,
Comfy-Org#19806,
Comfy-Org#19807) and FE-3117's
parts 1 and 2 (Comfy-Org#19809,
Comfy-Org#19810). The base of
this PR is main. Review only part 3's own change (E13, the resubscribe
lifecycle, 9 files against main). This branch also carries one automated
formatting commit.
- The new `source` value is `billing_web_subscription`. The catalog says
only "billing web value". The cloud names its two values after its own
screens (`pricing_dialog`, `settings_billing_panel`), so I named this
one after billing web's subscription screen. It is a one-line change in
`vocabulary.ts` if you prefer another name.
- `billing_client: 'sdk'` is stamped, as on the checkout events, because
billing web has no legacy path.
- A resubscribe that needs a hosted payment step redirects this tab, so
the page unloads and no terminal is sent. That start is the abandoned
case of FE-3119. A recovered operation after the return reports only the
SDK stream, never `billing.resubscribe.*`, as the SSOT requires.
- There is no continuation state for resubscribe: the SDK never asks for
the reactivation consent on this command.
- The SDK stream still reports the same resubscribe as
`billing.operation.*` with `operation_type: 'subscription'`. Join the
two by `billing_op_id`. They are two signals of one attempt, not two
attempts.
- E14 (billing web cancel intent, abandoned and failed) is not built.
FE-3115 defines the cancel event contract first, so E14 follows it.
Billing web's cancel today reports only the SDK stream. A test pins that
a cancel emits no `billing.resubscribe.*` event.
- Known gap: billing web rebuilds its return links without `source`, so
a resubscribe that returns from a provider page cannot carry the entry
source. It reports no business event there anyway.
- No user-visible change. Billing web sends new RUM actions and PostHog
events and nothing else changes.
- `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe")
fails locally on `origin/main` too under Node 24. This diff does not
touch it.

## AS IS / TO BE

AS IS: ![AS IS at 96c1f28 with this PR's new tests copied in: 6 of 8
scenarios off contract. A resubscribe from the subscription screen
reports only the SDK stream when an operation is issued
(billing.operation.started, then succeeded or failed) and nothing at all
for an already-active plan, a 503, a network failure and an operation
already pending, so no billing.resubscribe event exists; a cancel
already reports only the SDK stream with operation_type cancel, and no
payload holds the planted server text; the new tests fail as expected
(resubscribeTelemetry.test.ts and billingWebClient.test.ts fail to load,
4 SubscriptionView tests red): apps/billing-web passes 1085 of 1089 and
account-core src/core/billing 600 of
600](https://github.com/user-attachments/assets/c0a3a848-c518-41d5-8030-16830933a9a5)

TO BE: ![TO BE at 8abe6fe: 8 of 8 scenarios on contract. A
resubscribe reports billing.resubscribe.started before the request and
then exactly one .succeeded or .failed with source
billing_web_subscription, billing_client sdk and the entry source: a
settled operation and a decline join the SDK stream through the same
billing_op_id (the decline adds provider_decline and card_declined), an
already-active plan counts as succeeded with no operation id and no SDK
events, and a 503, a network failure and an operation already pending
end with api_rejected, network and operation_already_pending; a cancel
emits only the SDK stream with operation_type cancel and no
billing.resubscribe event; the planted server messages, codes, email,
URL and secret appear in none of 36 payloads; apps/billing-web passes
1111 of 1111 and account-core src/core/billing 600 of
600](https://github.com/user-attachments/assets/93bd4c48-5b6b-46ab-b338-80accbda64f9)

The evidence is the RUM actions billing web sends when a customer
resubscribes from the subscription screen and the request settles, is a
plan that was already active, is declined, or is refused before an
operation exists: before, none; after, `billing.resubscribe.started` and
one terminal with `billing_client: 'sdk'` and the billing web source.

## Where this sits in the plan

Linear: [FE-3117](https://linear.app/comfyorg/issue/FE-3117), part of
[FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards).
Plan, event catalog and dependency graph: [action
items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89).

| Task | Ticket | What | Status |
| --- | --- | --- | --- |
| T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT |
| T2 | FE-3108 | Decide RUM application and env mapping | decided |
| T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR
19688](Comfy-Org#19688), merged
|
| T3+ | FE-3156 | Opaque RUM user id on billing web | [PR
19794](Comfy-Org#19794), merged
|
| T4, F1 | FE-3106 | SDK-rail ownership | [PR
19620](Comfy-Org#19620), merged
|
| T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR
19623](Comfy-Org#19623), merged
|
| T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR
19685](Comfy-Org#19685), merged
|
| T4, F5 | FE-3112 | SDK top-up terminals | [PR
19628](Comfy-Org#19628), merged
|
| T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR
19622](Comfy-Org#19622), merged
|
| T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR
19627](Comfy-Org#19627), merged
|
| T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices |
[PR 19686](Comfy-Org#19686),
merged |
| T4+ | FE-3140 | Move the billing event contract to a shared package |
[PR 19798](Comfy-Org#19798),
merged |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](Comfy-Org#19815), [PR
19816](Comfy-Org#19816), [PR
19817](Comfy-Org#19817), [PR
19818](Comfy-Org#19818), in
review |
| T6 | FE-3116 | Handoff contract and event | [PR
19687](Comfy-Org#19687), merged
|
| T7 | FE-3117 | Billing web attempt lifecycle | this PR |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819), [PR
19821](Comfy-Org#19821), [PR
19822](Comfy-Org#19822), in
review |
| T9 | FE-3119 | Payment friction events | todo |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](Comfy-Org#19804), [PR
19806](Comfy-Org#19806) and [PR
19807](Comfy-Org#19807), merged
in [PR 19798](Comfy-Org#19798)
|
| T11 | FE-3121 | Portal events | todo |
| T12 | FE-3122 | Flag coverage check | todo |
| T13 | FE-3123 | PostHog rollout dashboard | todo |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo |
| T15 | FE-3125 | Verification per flow | todo |
| T16 | FE-3126 | Rollout plan | todo |

```mermaid
flowchart LR
  subgraph DEC["Decided"]
    T1["FE-3107 T1 vocabulary"]
    T2["FE-3108 T2 RUM app and env"]
  end
  subgraph FIX["Existing events (T4)"]
    F1["FE-3106 F1 SDK-rail ownership"]
    F2["FE-3110 F2 mapper fields"]
    F3["FE-3111 F3 surface and client"]
    F5["FE-3112 F5 top-up terminals"]
    F6["FE-3113 F6 downgrade terminal"]
    F7["FE-3114 F7 legacy personal, first slice"]
    F7B["FE-3131 F7 remaining slices"]
    C140["FE-3140 event contract to shared package"]
  end
  subgraph EMIT["New events"]
    T3["FE-3109 T3 billing web bootstrap"]
    T3b["FE-3156 T3+ opaque RUM user id"]
    T5["FE-3115 T5 cloud entry and parity"]
    T6["FE-3116 T6 handoff contract"]
    T7["FE-3117 T7 attempt lifecycle"]
    T8["FE-3118 T8 journey and choices"]
    T9["FE-3119 T9 friction"]
    T10["FE-3120 T10 entry, session, return"]
    T11["FE-3121 T11 portal"]
    T12["FE-3122 T12 flag coverage"]
  end
  subgraph DASH["Dashboards"]
    T13["FE-3123 T13 PostHog rollout"]
    T14["FE-3124 T14 Frontend RUM tiles"]
  end
  T15["FE-3125 T15 verification"]
  T16["FE-3126 T16 rollout plan"]
  T2 --> T3
  T3 --> T3b
  F3 --> C140
  T3 --> C140
  C140 --> T7
  C140 --> T8
  C140 --> T10
  C140 --> T11
  T1 --> F3
  T1 --> T5
  T1 --> T6
  T1 --> T13
  T1 --> T14
  T2 --> T14
  F2 --> T7
  T3 --> T7
  T3 --> T8
  T3 --> T10
  T3 --> T11
  T3 --> T12
  T5 --> T11
  T6 --> T8
  T6 --> T10
  T7 --> T9
  T8 --> T9
  F1 --> T13
  F3 --> T13
  FIX --> T15
  T5 --> T15
  T9 --> T15
  T10 --> T15
  T11 --> T15
  T12 --> T15
  T13 --> T15
  T14 --> T15
  T13 --> T16
  T15 --> T16
  style T7 stroke-width:3px
```

---------

Co-authored-by: GitHub Action <action@github.com>
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