Skip to content

FE-3121 feat(billing): report portal opens, failures and returns on the cloud app and billing web - #19944

Merged
dante01yoon merged 4 commits into
jaewon/fe-3115-cloud-entry-fidelity-and-datadog-parity-paywall-add-creditsfrom
jaewon/fe-3121-portal-events-on-both-hosts-payment-methods-invoices-manage
Oct 3, 2026
Merged

dante01yoon merged 4 commits into
jaewon/fe-3115-cloud-entry-fidelity-and-datadog-parity-paywall-add-creditsfrom
jaewon/fe-3121-portal-events-on-both-hosts-payment-methods-invoices-manage

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Summary

The cloud app and billing web report each trip to the Stripe portal as billing.portal.opened, billing.portal.failed and billing.portal.returned, with a bounded target of payment_methods, invoices or manage_subscription.

Why

Opening the Stripe portal, failing to open it and coming back were not recorded on either host. A portal failure reached error reporting only, so the Datadog Billing UI tab and the PostHog rollout dashboard could not count it. What the customer does inside the portal (add, remove or set a default card) never reaches the browser, so the trip itself is the only signal we can have.

How

A new contract module, portalEvent.ts, defines PortalBillingEvent (operation portal, stages opened, failed and returned) and BillingPortalTarget. It adds one line to the BillingTelemetryEvent union, three names to BILLING_TELEMETRY_EVENTS and target to the payload allowlist as a required field. On the cloud app, createBillingPortalReporter reports the open, the failure (blocked tab as redirect with payment_popup_blocked, other errors through describeBillingFailure) and the first return to the tab, using the same return signal as the billing refresh. Personal Manage subscription and Invoice history call it with billing_client legacy and keep their existing error toast and error report. Workspace Manage subscription calls it with billing_client sdk or legacy depending on which rail served the portal URL. On billing web, a usePaymentPortal composable now owns opening the portal and the portal=return marker for both the payment methods panel and the invoices page; it reports opened, failed (network, api_rejected, or unknown for a malformed URL) and returned once on landing. The invoices page's return URL now carries portal=return and strips it on arrival. There is no user-visible change.

Review Focus

  • One return per open on the cloud app: only the latest open waits for a return, through a module-level stop handle in billingPortalTelemetry.ts.
  • Workspace Manage subscription reports billing_client only when it knows which rail answered; a thrown failure omits it.
  • useSubscription now calls accessBillingPortalDirect inside its own error wrapper so it can classify the failure; the toast and reportError behavior is unchanged.
  • PaymentMethodsPanel and InvoicesView moved their portal logic into usePaymentPortal; the invoices page now gets the portal=return marker and strips it.
  • Out of scope: the portal used for a plan change in PricingTable (its operation events already cover it), the payment recovery portal in useSubscriptionCheckout, and the hosted billing web tab that workspace Manage subscription opens when hosted billing is on (that is billing.web_handoff.opened).

AS IS / TO BE

Captured through the real telemetry providers in the component and composable tests (Datadog RUM action and PostHog event carry identical payloads, billing_surface per host). AS IS = base branch, TO BE = this branch.

Path Host AS IS TO BE
reports manageSubscription opening the portal and one return cloud_app nothing billing.portal.opened (target: manage_subscription, billing_client: legacy)
billing.portal.returned (target: manage_subscription, billing_client: legacy)
reports handleInvoiceHistory opening the portal and one return cloud_app nothing billing.portal.opened (target: invoices, billing_client: legacy)
billing.portal.returned (target: invoices, billing_client: legacy)
reports manageSubscription as a failed open when the tab is blocked cloud_app nothing billing.portal.failed (target: manage_subscription, billing_client: legacy, failure_category: redirect, error_code: payment_popup_blocked)
reports handleInvoiceHistory as a failed open when the tab is blocked cloud_app nothing billing.portal.failed (target: invoices, billing_client: legacy, failure_category: redirect, error_code: payment_popup_blocked)
reports a refused portal request as a failed open and still reports the error cloud_app nothing billing.portal.failed (target: manage_subscription, billing_client: legacy, failure_category: api_rejected)
reports the portal opening from the SDK rail and one return cloud_app nothing billing.portal.opened (target: manage_subscription, billing_client: sdk)
billing.portal.returned (target: manage_subscription, billing_client: sdk)
reports the portal opening from the workspace client and one return cloud_app nothing billing.portal.opened (target: manage_subscription, billing_client: legacy)
billing.portal.returned (target: manage_subscription, billing_client: legacy)
reports a blocked portal tab as a failed open cloud_app nothing billing.portal.failed (target: manage_subscription, failure_category: redirect, error_code: payment_popup_blocked)
reports a refused portal request as a failed open cloud_app nothing billing.portal.failed (target: manage_subscription, failure_category: api_rejected)
reports the portal opening on the invoices billing_web nothing billing.portal.opened (target: invoices, billing_client: sdk)
reports the portal opening on the payment methods billing_web nothing billing.portal.opened (target: payment_methods, billing_client: sdk)
reports a portal it could not open as a failed open billing_web nothing billing.portal.failed (target: payment_methods, billing_client: sdk, failure_category: api_rejected)
reports the return from the portal once and drops the marker billing_web nothing billing.portal.returned (target: invoices, billing_client: sdk)
reports the return from the portal once billing_web nothing billing.portal.returned (target: payment_methods, billing_client: sdk)
reports a request that never reached the server as a failed portal open billing_web nothing billing.portal.failed (target: invoices, billing_client: sdk, failure_category: network)
reports a refusal from the server as a failed portal open billing_web nothing billing.portal.failed (target: invoices, billing_client: sdk, failure_category: api_rejected)
reports a portal address that fails validation as a failed portal open billing_web nothing billing.portal.failed (target: invoices, billing_client: sdk, failure_category: unknown)

Captured RUM actions and PostHog events for each path on both hosts show nothing on the FE-3115 base and the matching billing.portal.* event with target, failure category and billing_surface on this branch (evidence-fe3121/).

Where this sits in the plan

Linear: FE-3121, 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, merged
T5 FE-3115 Cloud entry fidelity and Datadog parity PR 19815 (four parts), 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, merged
T8 FE-3118 Billing web journey and choices PR 19819 (three parts), merged
T9 FE-3119 Payment friction events todo
T10 FE-3120 Billing web entry, session and return PR 19804, PR 19806 and PR 19807, merged in PR 19798
T11 FE-3121 Portal events this PR
T12 FE-3122 Flag coverage check PR 19942, in review
T13 FE-3123 PostHog rollout dashboard specified, blocked on PostHog key scopes
T14 FE-3124 Datadog tiles in the Frontend RUM dashboard comfy-infra PR 1597, in review
T4+ FE-3162 Move the payload-helper tests to account-core PR 19940, in review
T10+ FE-3158 Billing web Try again after session creation fails PR 19941, in review
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 T11 stroke-width:3px
Loading

@coderabbitai

coderabbitai Bot commented Oct 2, 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: bcd605fa-755a-414d-b4af-009f788c5743

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 2, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 10/02/2026, 10:23:03 PM UTC

Links

🌾 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 e1ba9553940b6e975c503d10670bd9f6cd3b5e02

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)

🧩 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

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.4 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.7 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 74.6 MB heap
dom-widget-clipping: · 59.3 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.4 MB heap
dom-widget-order-dense-n200-w200-i120: · 29.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 508ms TBT · 88.9 MB heap
dom-widget-order-sparse-n1000-w20-i120: · 43.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 155ms TBT · 112.4 MB heap
extension-clean-combined-draw: · 34.4 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 169ms TBT · 64.9 MB heap
extension-rgthree-prototype-draw: · 34.2 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 111ms TBT · 72.0 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.0 MB heap
large-graph-pan: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 85.8 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.6 MB heap
legacy-node-drag: · 59.7 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 85.5 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.3 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 57.8 MB heap
subgraph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.7 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.1 MB heap
subgraph-transition-enter: · 51.7 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 128ms TBT · 103.3 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 75.3 MB heap
vue-large-graph-idle: · 40.1 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 169.6 MB heap
vue-large-graph-pan: · 30.6 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 23ms TBT · 159.1 MB heap
vue-node-resize-workload: · 31.3 avg FPS · 15.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 203.4 MB heap
vue-zoom-out-idle: · 39.5 avg FPS · 20.0 P5 FPS ❌ (target: ≥52) · 0ms TBT · 157.4 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.8 MB heap
agent-composer-empty-conversation-typing: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.0 MB heap
agent-composer-long-conversation-typing: · 58.5 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 105.9 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 9
canvas-idle: task duration 386ms
canvas-idle: script duration 9ms
canvas-idle: TBT 0ms
canvas-idle: heap used 68.4 MB
canvas-idle: DOM nodes 0
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 63
canvas-mouse-sweep: task duration 713ms
canvas-mouse-sweep: script duration 136ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 65.7 MB
canvas-mouse-sweep: DOM nodes 0
canvas-mouse-sweep: event listeners 0
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 9ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 30
canvas-zoom-sweep: task duration 336ms
canvas-zoom-sweep: script duration 12ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 74.6 MB
canvas-zoom-sweep: DOM nodes -63
canvas-zoom-sweep: event listeners -67
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 11
dom-widget-clipping: task duration 456ms
dom-widget-clipping: script duration 155ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 65.4 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 784ms
dom-widget-order-dense-n200-w200-i120: script duration 61ms
dom-widget-order-dense-n200-w200-i120: TBT 508ms
dom-widget-order-dense-n200-w200-i120: heap used 88.9 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 23ms
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 396ms
dom-widget-order-sparse-n1000-w20-i120: script duration 136ms
dom-widget-order-sparse-n1000-w20-i120: TBT 155ms
dom-widget-order-sparse-n1000-w20-i120: heap used 112.4 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 29ms
extension-clean-combined-draw: p95 frame time 50ms
extension-clean-combined-draw: layout duration 0ms
extension-clean-combined-draw: style recalc duration 1ms
extension-clean-combined-draw: layout count 0
extension-clean-combined-draw: style recalc count 3
extension-clean-combined-draw: task duration 7674ms
extension-clean-combined-draw: script duration 5956ms
extension-clean-combined-draw: TBT 169ms
extension-clean-combined-draw: heap used 64.9 MB
extension-clean-combined-draw: DOM nodes -142
extension-clean-combined-draw: event listeners -78
extension-rgthree-prototype-draw: avg frame time 29ms
extension-rgthree-prototype-draw: p95 frame time 50ms
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 2
extension-rgthree-prototype-draw: task duration 7157ms
extension-rgthree-prototype-draw: script duration 5485ms
extension-rgthree-prototype-draw: TBT 111ms
extension-rgthree-prototype-draw: heap used 72.0 MB
extension-rgthree-prototype-draw: DOM nodes -71
extension-rgthree-prototype-draw: event listeners -37
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 2ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 7
large-graph-idle: task duration 521ms
large-graph-idle: script duration 31ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 79.0 MB
large-graph-idle: DOM nodes -328
large-graph-idle: event listeners -164
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 12ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 69
large-graph-pan: task duration 1562ms
large-graph-pan: script duration 778ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 85.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 16ms
large-graph-zoom: style recalc duration 14ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 65
large-graph-zoom: task duration 1633ms
large-graph-zoom: script duration 720ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 71.6 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 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 43
legacy-node-drag: task duration 1786ms
legacy-node-drag: script duration 854ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 85.5 MB
legacy-node-drag: DOM nodes -164
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 523ms
minimap-idle: script duration 35ms
minimap-idle: TBT 0ms
minimap-idle: heap used 83.3 MB
minimap-idle: DOM nodes 0
minimap-idle: event listeners 0
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 5ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 44
subgraph-dom-widget-clipping: task duration 370ms
subgraph-dom-widget-clipping: script duration 132ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 57.8 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 3ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 9
subgraph-idle: task duration 401ms
subgraph-idle: script duration 10ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 63.7 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 6ms
subgraph-mouse-sweep: style recalc duration 17ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 76
subgraph-mouse-sweep: task duration 689ms
subgraph-mouse-sweep: script duration 97ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 66.1 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 10ms
subgraph-transition-enter: style recalc duration 25ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 19
subgraph-transition-enter: task duration 815ms
subgraph-transition-enter: script duration 27ms
subgraph-transition-enter: TBT 128ms
subgraph-transition-enter: heap used 103.3 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 41ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 5514ms
viewport-pan-sweep: script duration 2476ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 75.3 MB
viewport-pan-sweep: DOM nodes -236
viewport-pan-sweep: event listeners -123
vue-large-graph-idle: avg frame time 25ms
vue-large-graph-idle: p95 frame time 50ms
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 14150ms
vue-large-graph-idle: script duration 261ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 169.6 MB
vue-large-graph-idle: DOM nodes -3045
vue-large-graph-idle: event listeners -14915
vue-large-graph-pan: avg frame time 33ms
vue-large-graph-pan: p95 frame time 67ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 21ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 155
vue-large-graph-pan: task duration 17669ms
vue-large-graph-pan: script duration 897ms
vue-large-graph-pan: TBT 23ms
vue-large-graph-pan: heap used 159.1 MB
vue-large-graph-pan: DOM nodes -3046
vue-large-graph-pan: event listeners -14915
vue-node-resize-workload: avg frame time 32ms
vue-node-resize-workload: p95 frame time 67ms
vue-node-resize-workload: layout duration 26ms
vue-node-resize-workload: style recalc duration 72ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 5322ms
vue-node-resize-workload: script duration 101ms
vue-node-resize-workload: TBT 0ms
vue-node-resize-workload: heap used 203.4 MB
vue-node-resize-workload: DOM nodes 0
vue-node-resize-workload: event listeners 0
vue-zoom-out-idle: avg frame time 25ms
vue-zoom-out-idle: p95 frame time 50ms
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 7169ms
vue-zoom-out-idle: script duration 146ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 157.4 MB
vue-zoom-out-idle: DOM nodes -3046
vue-zoom-out-idle: event listeners -14915
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 12ms
workflow-execution: layout count 3
workflow-execution: style recalc count 14
workflow-execution: task duration 115ms
workflow-execution: script duration 10ms
workflow-execution: TBT 0ms
workflow-execution: heap used 61.8 MB
workflow-execution: DOM nodes -15
workflow-execution: event listeners -13
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 22ms
agent-composer-empty-conversation-typing: style recalc duration 96ms
agent-composer-empty-conversation-typing: layout count 76
agent-composer-empty-conversation-typing: style recalc count 78
agent-composer-empty-conversation-typing: task duration 683ms
agent-composer-empty-conversation-typing: script duration 260ms
agent-composer-empty-conversation-typing: TBT 0ms
agent-composer-empty-conversation-typing: heap used 79.0 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 17ms
agent-composer-long-conversation-typing: p95 frame time 17ms
agent-composer-long-conversation-typing: layout duration 28ms
agent-composer-long-conversation-typing: style recalc duration 258ms
agent-composer-long-conversation-typing: layout count 76
agent-composer-long-conversation-typing: style recalc count 78
agent-composer-long-conversation-typing: task duration 1305ms
agent-composer-long-conversation-typing: script duration 410ms
agent-composer-long-conversation-typing: TBT 0ms
agent-composer-long-conversation-typing: heap used 105.9 MB
agent-composer-long-conversation-typing: DOM nodes 76
agent-composer-long-conversation-typing: event listeners 876
Raw data
{
  "timestamp": "2026-10-02T22:34:56.119Z",
  "gitSha": "bb25629fc7f6a92d832114d37c9ea0a5035cce36",
  "branch": "jaewon/fe-3121-portal-events-on-both-hosts-payment-methods-invoices-manage",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2022.6000000000113,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 2.8680000000000008,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 391.135,
      "heapDeltaBytes": 373624,
      "heapUsedBytes": 67384092,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 9.496999999999991,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666942148760327,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-idle",
      "durationMs": 2017.7150000000665,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 2.93,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 381.112,
      "heapDeltaBytes": 22281920,
      "heapUsedBytes": 76143132,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 9.362000000000002,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1743.0309999999736,
      "styleRecalcs": 53,
      "styleRecalcDurationMs": 14.759999999999998,
      "layouts": 12,
      "layoutDurationMs": 4.209,
      "taskDurationMs": 704.4540000000001,
      "heapDeltaBytes": 19529776,
      "heapUsedBytes": 73684348,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 133.03,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666346153846145,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1713.9080000000604,
      "styleRecalcs": 73,
      "styleRecalcDurationMs": 16.537000000000003,
      "layouts": 12,
      "layoutDurationMs": 4.419999999999999,
      "taskDurationMs": 721.87,
      "heapDeltaBytes": -2535524,
      "heapUsedBytes": 64108184,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 139.721,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666019417475724,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1721.6060000000653,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 10.759,
      "layouts": 6,
      "layoutDurationMs": 1.4949999999999999,
      "taskDurationMs": 359.76399999999995,
      "heapDeltaBytes": -24236036,
      "heapUsedBytes": 77894660,
      "domNodes": -179,
      "jsHeapTotalBytes": -3932160,
      "scriptDurationMs": 12.471,
      "eventListeners": -149,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66601941747573,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1695.0760000000855,
      "styleRecalcs": 29,
      "styleRecalcDurationMs": 7.456999999999998,
      "layouts": 6,
      "layoutDurationMs": 1.2339999999999998,
      "taskDurationMs": 311.635,
      "heapDeltaBytes": 25273308,
      "heapUsedBytes": 78636888,
      "domNodes": 53,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.917,
      "eventListeners": 15,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66568627450981,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 667.2869999999875,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 2.3129999999999993,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 414.46599999999995,
      "heapDeltaBytes": 15284376,
      "heapUsedBytes": 69209364,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 148.885,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66500000000001,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 725.4070000000183,
      "styleRecalcs": 13,
      "styleRecalcDurationMs": 4.832,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 498.41999999999996,
      "heapDeltaBytes": -34317320,
      "heapUsedBytes": 68020424,
      "domNodes": -232,
      "jsHeapTotalBytes": -2359296,
      "scriptDurationMs": 160.53900000000002,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.053488372093007,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1141.2169999999833,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 789.605,
      "heapDeltaBytes": 13589164,
      "heapUsedBytes": 92961056,
      "domNodes": 0,
      "jsHeapTotalBytes": 4358144,
      "scriptDurationMs": 59.727000000000004,
      "eventListeners": 0,
      "totalBlockingTimeMs": 514,
      "frameDurationMs": 34.339393939393936,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-dense-n200-w200-i120",
      "durationMs": 1122.1590000000106,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 778.879,
      "heapDeltaBytes": 13861984,
      "heapUsedBytes": 93494768,
      "domNodes": 0,
      "jsHeapTotalBytes": 5668864,
      "scriptDurationMs": 63.221,
      "eventListeners": 0,
      "totalBlockingTimeMs": 502,
      "frameDurationMs": 33.83636363636365,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 780.5659999999648,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 390.85000000000036,
      "heapDeltaBytes": 16570876,
      "heapUsedBytes": 117059112,
      "domNodes": 0,
      "jsHeapTotalBytes": 3411968,
      "scriptDurationMs": 134.28699999999998,
      "eventListeners": 0,
      "totalBlockingTimeMs": 155,
      "frameDurationMs": 23.03823529411768,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-order-sparse-n1000-w20-i120",
      "durationMs": 813.8129999999819,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 402.0569999999997,
      "heapDeltaBytes": 18132924,
      "heapUsedBytes": 118709524,
      "domNodes": 0,
      "jsHeapTotalBytes": 3936256,
      "scriptDurationMs": 138.06199999999995,
      "eventListeners": 0,
      "totalBlockingTimeMs": 154,
      "frameDurationMs": 23.526470588235284,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 9117.390999999998,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 1.0620000000000005,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8074.189,
      "heapDeltaBytes": -8232236,
      "heapUsedBytes": 67930488,
      "domNodes": -142,
      "jsHeapTotalBytes": -8261632,
      "scriptDurationMs": 6298.584,
      "eventListeners": -78,
      "totalBlockingTimeMs": 249,
      "frameDurationMs": 29.987828947368424,
      "p95FrameDurationMs": 50.100000000000364
    },
    {
      "name": "extension-clean-combined-draw",
      "durationMs": 8148.904000000016,
      "styleRecalcs": 2,
      "styleRecalcDurationMs": 0.5800000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7272.967000000001,
      "heapDeltaBytes": -8630980,
      "heapUsedBytes": 68117588,
      "domNodes": -142,
      "jsHeapTotalBytes": -7999488,
      "scriptDurationMs": 5612.433,
      "eventListeners": -78,
      "totalBlockingTimeMs": 88,
      "frameDurationMs": 28.141868512110722,
      "p95FrameDurationMs": 50.099999999998545
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 7825.512000000003,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7015.268,
      "heapDeltaBytes": -3899128,
      "heapUsedBytes": 77561416,
      "domNodes": 0,
      "jsHeapTotalBytes": -13369344,
      "scriptDurationMs": 5337.661,
      "eventListeners": 0,
      "totalBlockingTimeMs": 115,
      "frameDurationMs": 28.736764705882354,
      "p95FrameDurationMs": 50
    },
    {
      "name": "extension-rgthree-prototype-draw",
      "durationMs": 7931.693999999993,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 0.7659999999999993,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7298.133,
      "heapDeltaBytes": 5751968,
      "heapUsedBytes": 73419212,
      "domNodes": -142,
      "jsHeapTotalBytes": -6950912,
      "scriptDurationMs": 5631.771,
      "eventListeners": -74,
      "totalBlockingTimeMs": 106,
      "frameDurationMs": 29.711610486891384,
      "p95FrameDurationMs": 50
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2034.1779999999972,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 2.113000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 522.267,
      "heapDeltaBytes": -39859824,
      "heapUsedBytes": 82899876,
      "domNodes": -328,
      "jsHeapTotalBytes": -3244032,
      "scriptDurationMs": 31.209,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.6655737704918,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2023.7160000000358,
      "styleRecalcs": 6,
      "styleRecalcDurationMs": 2.3749999999999987,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 520.3870000000001,
      "heapDeltaBytes": 20772724,
      "heapUsedBytes": 82756148,
      "domNodes": -328,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 30.510999999999996,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665289256198346,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2182.0579999999836,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 10.615999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1427.5929999999998,
      "heapDeltaBytes": 24378820,
      "heapUsedBytes": 87139232,
      "domNodes": 0,
      "jsHeapTotalBytes": 225280,
      "scriptDurationMs": 704.656,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665384615384614,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2948.3940000000075,
      "styleRecalcs": 70,
      "styleRecalcDurationMs": 12.730000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1697.155,
      "heapDeltaBytes": 6511648,
      "heapUsedBytes": 92777252,
      "domNodes": 0,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 851.752,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3640.4119999999693,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 12.743,
      "layouts": 60,
      "layoutDurationMs": 15.702999999999998,
      "taskDurationMs": 1573.428,
      "heapDeltaBytes": 8226600,
      "heapUsedBytes": 72632284,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 684.148,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666055045871563,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3807.8190000001086,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 14.991999999999999,
      "layouts": 60,
      "layoutDurationMs": 16.275000000000002,
      "taskDurationMs": 1693.563,
      "heapDeltaBytes": -11756544,
      "heapUsedBytes": 77483876,
      "domNodes": 0,
      "jsHeapTotalBytes": 561152,
      "scriptDurationMs": 754.9440000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665789473684207,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3064.734999999928,
      "styleRecalcs": 43,
      "styleRecalcDurationMs": 6.501000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1761.1429999999996,
      "heapDeltaBytes": 23384852,
      "heapUsedBytes": 87651220,
      "domNodes": -328,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 844.268,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.756830601092897,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3139.7720000001073,
      "styleRecalcs": 42,
      "styleRecalcDurationMs": 6.258999999999997,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1810.327,
      "heapDeltaBytes": 27499360,
      "heapUsedBytes": 91699900,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 864.5090000000001,
      "eventListeners": 180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.755080213903742,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2012.9109999999173,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 2.972000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 509.6409999999999,
      "heapDeltaBytes": -328360,
      "heapUsedBytes": 87489684,
      "domNodes": 0,
      "jsHeapTotalBytes": -225280,
      "scriptDurationMs": 32.999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2013.6019999999917,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 2.623,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 536.7669999999999,
      "heapDeltaBytes": -505684,
      "heapUsedBytes": 87277224,
      "domNodes": 0,
      "jsHeapTotalBytes": -225280,
      "scriptDurationMs": 37.27599999999999,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479342,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 562.4880000000303,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 4.853999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 360.5199999999999,
      "heapDeltaBytes": 9760064,
      "heapUsedBytes": 63796872,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 130.267,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66470588235295,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 616.1800000000994,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 5.273999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 380.43999999999994,
      "heapDeltaBytes": -11789444,
      "heapUsedBytes": 57425580,
      "domNodes": 0,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 133.19400000000002,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66486486486485,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2013.693000000103,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 2.605999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 399.764,
      "heapDeltaBytes": 21987800,
      "heapUsedBytes": 75587916,
      "domNodes": -250,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 9.314,
      "eventListeners": -210,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666115702479342,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2009.50499999999,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 3.852999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 402.88800000000003,
      "heapDeltaBytes": -3924712,
      "heapUsedBytes": 57937004,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 9.738,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665289256198346,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1691.1219999999503,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 17.355000000000004,
      "layouts": 16,
      "layoutDurationMs": 5.823,
      "taskDurationMs": 675.7189999999999,
      "heapDeltaBytes": 15353364,
      "heapUsedBytes": 69307772,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 94.784,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.6656862745098,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1691.7159999999285,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 16.253999999999998,
      "layouts": 16,
      "layoutDurationMs": 5.545999999999999,
      "taskDurationMs": 703.074,
      "heapDeltaBytes": 15327616,
      "heapUsedBytes": 69298084,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 100.008,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1200.3139999999348,
      "styleRecalcs": 19,
      "styleRecalcDurationMs": 25.378999999999998,
      "layouts": 5,
      "layoutDurationMs": 9.861000000000002,
      "taskDurationMs": 815.2680000000001,
      "heapDeltaBytes": 22183232,
      "heapUsedBytes": 108346576,
      "domNodes": 13747,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 27.164,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 128,
      "frameDurationMs": 19.35483870967742,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8376.946000000089,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 39.482000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5300.322999999999,
      "heapDeltaBytes": -40480756,
      "heapUsedBytes": 83010016,
      "domNodes": -328,
      "jsHeapTotalBytes": -3575808,
      "scriptDurationMs": 2341.1630000000005,
      "eventListeners": -164,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665936254980082,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 9125.368999999977,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 41.63799999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5727.955,
      "heapDeltaBytes": -11500732,
      "heapUsedBytes": 74829836,
      "domNodes": -143,
      "jsHeapTotalBytes": -8556544,
      "scriptDurationMs": 2611.2990000000004,
      "eventListeners": -82,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.665996343692868,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 14879.279999999995,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 14320.233000000002,
      "heapDeltaBytes": -28948692,
      "heapUsedBytes": 180754324,
      "domNodes": -3045,
      "jsHeapTotalBytes": 4018176,
      "scriptDurationMs": 248.49699999999999,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 25.196949152542373,
      "p95FrameDurationMs": 50
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 14577.83699999993,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 13979.588,
      "heapDeltaBytes": -50266096,
      "heapUsedBytes": 174867364,
      "domNodes": -3045,
      "jsHeapTotalBytes": 4718592,
      "scriptDurationMs": 273.60499999999996,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 24.730220713073003,
      "p95FrameDurationMs": 49.900000000001455
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 17963.132999999973,
      "styleRecalcs": 155,
      "styleRecalcDurationMs": 20.41599999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17536.246,
      "heapDeltaBytes": -44614656,
      "heapUsedBytes": 167030096,
      "domNodes": -3045,
      "jsHeapTotalBytes": 5120000,
      "scriptDurationMs": 881.7139999999999,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 28,
      "frameDurationMs": 32.63647912885663,
      "p95FrameDurationMs": 66.69999999999891
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 18142.62000000008,
      "styleRecalcs": 155,
      "styleRecalcDurationMs": 22.038000000000004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17802.603,
      "heapDeltaBytes": -44788904,
      "heapUsedBytes": 166701908,
      "domNodes": -3046,
      "jsHeapTotalBytes": 5382144,
      "scriptDurationMs": 912.166,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 18,
      "frameDurationMs": 32.81971066907776,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 5455.212999999958,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 72.51300000000002,
      "layouts": 20,
      "layoutDurationMs": 26.451,
      "taskDurationMs": 5318.454999999999,
      "heapDeltaBytes": 21141312,
      "heapUsedBytes": 220985864,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 102.069,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 31.96725146198831,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 5510.872000000063,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 71.58899999999998,
      "layouts": 20,
      "layoutDurationMs": 26.061,
      "taskDurationMs": 5325.98,
      "heapDeltaBytes": -6138784,
      "heapUsedBytes": 205579160,
      "domNodes": 0,
      "jsHeapTotalBytes": 786432,
      "scriptDurationMs": 99.086,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 31.886705202312147,
      "p95FrameDurationMs": 66.70000000000073
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 7471.055999999976,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7113.749000000001,
      "heapDeltaBytes": -50980844,
      "heapUsedBytes": 168033728,
      "domNodes": -3045,
      "jsHeapTotalBytes": 4071424,
      "scriptDurationMs": 167.57699999999997,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 25.139393939393944,
      "p95FrameDurationMs": 50
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 7496.792000000028,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 7223.818999999999,
      "heapDeltaBytes": -47874412,
      "heapUsedBytes": 161985500,
      "domNodes": -3046,
      "jsHeapTotalBytes": 4595712,
      "scriptDurationMs": 124.32799999999993,
      "eventListeners": -14915,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 25.50918367346939,
      "p95FrameDurationMs": 50
    },
    {
      "name": "workflow-execution",
      "durationMs": 453.1419999999571,
      "styleRecalcs": 14,
      "styleRecalcDurationMs": 11.541,
      "layouts": 3,
      "layoutDurationMs": 0.954,
      "taskDurationMs": 110.95700000000002,
      "heapDeltaBytes": 5655924,
      "heapUsedBytes": 70635636,
      "domNodes": 102,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 11.206000000000001,
      "eventListeners": 65,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.662962962962983,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "workflow-execution",
      "durationMs": 470.7300000000032,
      "styleRecalcs": 14,
      "styleRecalcDurationMs": 13.422,
      "layouts": 3,
      "layoutDurationMs": 0.962,
      "taskDurationMs": 119.74699999999999,
      "heapDeltaBytes": 5584644,
      "heapUsedBytes": 58928592,
      "domNodes": -132,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 9.378999999999998,
      "eventListeners": -90,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.668965517241368,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 768.3819999999741,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 96.056,
      "layouts": 76,
      "layoutDurationMs": 22.544999999999998,
      "taskDurationMs": 732.26,
      "heapDeltaBytes": 16854540,
      "heapUsedBytes": 82797768,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 285.217,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.667391304347824,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "agent-composer-empty-conversation-typing",
      "durationMs": 676.5819999999394,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 95.22500000000001,
      "layouts": 76,
      "layoutDurationMs": 21.534000000000002,
      "taskDurationMs": 633.559,
      "heapDeltaBytes": 15713548,
      "heapUsedBytes": 82893656,
      "domNodes": 76,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 235.38899999999998,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66341463414634,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1325.1080000000002,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 260.25,
      "layouts": 76,
      "layoutDurationMs": 28.948999999999998,
      "taskDurationMs": 1309.152,
      "heapDeltaBytes": 8472520,
      "heapUsedBytes": 113556064,
      "domNodes": 76,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 408.493,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.092307692307703,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "agent-composer-long-conversation-typing",
      "durationMs": 1326.298999999949,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 256.405,
      "layouts": 76,
      "layoutDurationMs": 27.48,
      "taskDurationMs": 1301.73,
      "heapDeltaBytes": -19188380,
      "heapUsedBytes": 108438268,
      "domNodes": 76,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 411.58099999999996,
      "eventListeners": 876,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.093589743589746,
      "p95FrameDurationMs": 16.80000000000109
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 53538 82014 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

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...tform/workspace/composables/useWorkspaceBilling.ts 92.85% 1 Missing ⚠️
@@                                              Coverage Diff                                               @@
##           jaewon/fe-3115-cloud-entry-fidelity-and-datadog-parity-paywall-add-credits   #19944      +/-   ##
==============================================================================================================
- Coverage                                                                       84.83%   84.79%   -0.05%     
==============================================================================================================
  Files                                                                            3434     3428       -6     
  Lines                                                                          164556   164038     -518     
  Branches                                                                        43195    42993     -202     
==============================================================================================================
- Hits                                                                           139603   139088     -515     
- Misses                                                                          22998    23005       +7     
+ Partials                                                                         1955     1945      -10     
Flag Coverage Δ
billing-web-unit 91.73% <100.00%> (-0.30%) ⬇️
e2e 65.28% <32.00%> (-0.01%) ⬇️
unit 82.26% <100.00%> (-0.06%) ⬇️
website-unit 79.85% <ø> (-0.09%) ⬇️

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

Files with missing lines Coverage Δ
...billing-web/src/components/PaymentMethodsPanel.vue 95.45% <100.00%> (+7.95%) ⬆️
...ps/billing-web/src/composables/usePaymentPortal.ts 100.00% <100.00%> (ø)
apps/billing-web/src/telemetry/portalTelemetry.ts 100.00% <100.00%> (ø)
apps/billing-web/src/views/InvoicesView.vue 100.00% <100.00%> (ø)
...rc/core/billing/telemetry/billingTelemetryEvent.ts 100.00% <ø> (ø)
...ount-core/src/core/billing/telemetry/eventNames.ts 100.00% <ø> (+50.00%) ⬆️
...account-core/src/core/billing/telemetry/payload.ts 100.00% <ø> (ø)
.../cloud/subscription/composables/useSubscription.ts 95.12% <100.00%> (+0.11%) ⬆️
...platform/telemetry/utils/billingPortalTelemetry.ts 100.00% <100.00%> (ø)
...tform/workspace/composables/useWorkspaceBilling.ts 95.90% <92.85%> (-0.18%) ⬇️

... and 59 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 2, 2026

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

Verdict: Approve. The portal telemetry is bounded to opened, failed, and returned stages with an explicit target, and both cloud app and billing web preserve their existing user-facing failure behavior.

I reviewed exact head d6dc0611c98ce4f61bdae58624ebc3aa43c1fe6e on stacked base e1ba9553940b6e975c503d10670bd9f6cd3b5e02. The shared contract keeps portal targets finite, the cloud reporter arms only one return callback for the latest successful open, and the hosted flow removes its return marker after reporting. Coverage includes SDK and legacy workspace rails, personal invoice and subscription paths, billing-web invoice and payment-method paths, blocked tabs, refused requests, malformed addresses, and one-shot returns. All hosted checks are settled green and there are no open review threads.

@dante01yoon
dante01yoon merged commit 9460619 into jaewon/fe-3115-cloud-entry-fidelity-and-datadog-parity-paywall-add-credits Oct 3, 2026
131 checks passed
@dante01yoon
dante01yoon deleted the jaewon/fe-3121-portal-events-on-both-hosts-payment-methods-invoices-manage branch October 3, 2026 00:48
dante01yoon added a commit that referenced this pull request Oct 3, 2026
…g screen (#19948)

## Summary

Report an abandoned checkout and the ending screen on the billing web
full-page checkout, and send the abandon to PostHog by beacon (E24,
E25).

## Why

customer_abandoned is the largest failure class on the backend, and the
browser had no event for a customer who closes the tab or goes back with
an unresolved checkout. The ending screen the customer saw was not
reported either, so a funnel could not tell a success screen from a
refusal.

## How

The shared journey contract gains two phases, billing.checkout.abandoned
(last_phase, exit) and billing.checkout.ended (ending_kind,
attribution), as union lines in checkoutJourney.ts with their payload
fields. They carry the journey context, so they join entered and
operation_linked on checkout_journey_id and billing_op_id.
useCheckoutJourney remembers the last progress phase, reports each new
ending kind once, and reports abandoned once, only before any ending.
The full-page checkout reports ended from its existing endingOf screen
and terminal attribution. It reports abandoned with exit page_exit on
pagehide, and with exit back from the Back control. It reports no
abandon when the page handed itself to a hosted step or a method's own
site. The billing web telemetry facade sends abandoned to PostHog with
transport sendBeacon. PostHog drains its queue on its own pagehide
listener, which runs before ours, so a plain capture there would be
queued and lost. There is no user-visible change.

## Review Focus

- Flush check: Datadog RUM 6.33 flushes by sendBeacon on
visibilitychange hidden, freeze and beforeunload. It has no pagehide
listener, but the browser fires visibilitychange after pagehide on
unload, so an action added in pagehide is sent. PostHog 1.402 drains by
beacon on pagehide, so only an event captured inside pagehide needs the
sendBeacon option.
- leftForPayment: a redirect to a hosted step or a non-card method's
site is a redirect_started, not an abandon.
- Existing journey tests now expect billing.checkout.ended after a
preview failure and after a success.
- Known gaps: the embedded billing web CheckoutView reports neither
phase. The cloud app reports no abandoned event, because its journey is
kept in session storage across dialogs and reloads, and whether a dialog
close ends it needs a product decision. A tab closed while already in
the background may not flush its RUM action, because visibilitychange
already fired; the derived count of starts without terminals covers it
(D8).

## AS IS / TO BE

Telemetry change, so the evidence is the captured events instead of a
screenshot: the real SDK lifecycle and the billing web checkout with
only the network edge and the telemetry SDKs (Datadog RUM, posthog-js)
stubbed. AS IS = origin/main, TO BE = this stack.

| Path | AS IS | TO BE |
| --- | --- | --- |
| E24 tab closed at the quote | `entered`, `preview_ready` | adds
`abandoned` (last_phase preview_ready, exit page_exit); PostHog copy
sent with `{transport: 'sendBeacon'}` |
| E24 Back control | `entered`, `preview_ready`, `web_return.clicked` |
adds `abandoned` (exit back), once, even though the page then unloads |
| E24 Alipay Pay leaving for its own site | no abandon | still no
abandon (it is a redirect) |
| E25 own payment succeeds | no ending event | `ended` (ending_kind
success, attribution started); no abandon when the tab closes after it |
| E25 refused workspace | no ending event | `ended` (ending_kind
refused), no attribution |

No payload carries an email, URL, client secret, promo code or provider
id; every new field is a bounded enum.

evidence-fe3119/as-is-billing-web.json shows the tab-close, Back,
success and refusal paths with no abandoned or ended event on main, and
to-be-billing-web.json shows abandoned with last_phase and exit to RUM
and to PostHog with transport sendBeacon, ended with ending_kind and
attribution, and no abandon for an Alipay Pay that left for its own
site.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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),
merged |
| T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR
19815](#19815) (four
parts), 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) merged,
billing web cancel [PR
19945](#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| T10 | FE-3120 | Billing web entry, session and return | [PR
19804](#19804), [PR
19806](#19806) and [PR
19807](#19807), merged
in [PR 19798](#19798)
|
| T11 | FE-3121 | Portal events | [PR
19944](#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | specified, blocked on
PostHog key scopes |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](#19941), in
review |
| 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 T9 stroke-width:3px
```
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…nside a billing operation (Comfy-Org#19946)

## Summary

Report 3DS challenges and retryable declines inside one billing
operation, from the SDK lifecycle, on the cloud app and billing web
(E22).

## Why

The backend files most failed subscribes as customer_abandoned or
expected payment failures, and the browser reported none of the friction
behind them. The SDK already tracked the challenge, but the driver's
verdict was thrown away and a retryable decline left no trace until the
operation ended.

## Root cause

usePaymentAttempt and the cloud SDK store call driveEmbeddedChallenge
with void, and the lifecycle only emitted billing.operation.* for start
and terminal. A pending operation could move through a challenge, its
verdict and several declines without one event.

## How

A new contract module checkoutChallengeEvent.ts adds
billing.checkout.challenge_required, challenge_completed and
challenge_failed to the BillingTelemetryEvent union (one line). All
stages stay pending, so they never count as terminals. A pure function
paymentFrictionBetween compares two states of one pending operation, and
the lifecycle runs it on every transition and at adoption.
challenge_required fires once per new client secret. challenge_completed
and challenge_failed fire on this tab's driver verdict. Each new
retryable decline reason fires challenge_failed with decline_reason,
except the server's echo of a challenge this tab already saw fail.
toBillingTelemetryEvent maps the three onto operation checkout. Billing
web forwards them through the existing onTelemetry wiring. The cloud
store forwards them for every operation, including an issued top-up
whose start and terminal the dialog reports. Fields are decline_reason,
presentation, operation_type, billing_op_id and resumed, all already in
the allowlist. There is no user-visible change.

## Review Focus

- paymentFrictionBetween: one required per client secret, no second
required when a failed challenge returns from the hosted page, and the
echo rule for a decline after a failed challenge.
- The cloud reportTelemetry change: friction events skip the top-up and
caller-started filters on purpose.
- challenge_failed carries decline_reason only for a server decline.
Without it, it is this tab's own verdict.
- Known gap: the legacy cloud rail (billingOperationStore and the legacy
subscribe path) reports no friction. Only the SDK rail does.

## AS IS / TO BE

Telemetry change, so the evidence is the captured events instead of a
screenshot: the real SDK lifecycle and the billing web checkout with
only the network edge and the telemetry SDKs (Datadog RUM, posthog-js)
stubbed. AS IS = origin/main, TO BE = this stack.

| Path | AS IS | TO BE |
| --- | --- | --- |
| E22 embedded 3DS challenge completed / failed |
`billing.operation.started` only | adds
`billing.checkout.challenge_required`, then `challenge_completed` or
`challenge_failed` (presentation embedded) |
| E22 retryable declines in one hosted operation |
`billing.operation.started` only | `challenge_failed` with
`decline_reason: card_declined`, then `insufficient_funds` (presentation
hosted) |
| E22 billing web SDK, real client | `billing.operation.started` only |
adds `challenge_failed` with `decline_reason`, to RUM and PostHog,
`billing_surface: billing_web` |

No payload carries an email, URL, client secret, promo code or provider
id; every new field is a bounded enum.

evidence-fe3119/as-is-lifecycle.json and to-be-lifecycle.json show the
same embedded challenge and hosted decline scenarios emitting only
billing.operation.started on main and the challenge events with
presentation and decline_reason on the branch, for both cloud_app and
billing_web payloads, and to-be-billing-web.json shows the billing web
SDK sending challenge_failed with decline_reason to RUM and PostHog.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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) (four
parts), 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) merged,
billing web cancel [PR
19945](Comfy-Org#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| 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 | [PR
19944](Comfy-Org#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | specified, blocked on
PostHog key scopes |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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 T9 stroke-width:3px
```
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…p amount and the cancel flow as billing events (Comfy-Org#19815)

## Summary

Cloud entry fidelity and Datadog parity, in five parts reviewed
together: paywall impressions and add-credits clicks as typed billing
entry events that reach Datadog, the entry source carried through
top-up, downgrade and recovered operations with one source vocabulary,
the amount and preset on `billing.topup.started`, and the cancel flow as
`billing.cancel.intent`, `.abandoned` and `.failed` through a
surface-free contract that billing web reuses, and each trip to the
Stripe portal as `billing.portal.opened`, `.failed` and `.returned` on
the cloud app and billing web.

## Why

PostHog, Mixpanel and GTM receive the paywall impression and the
add-credits click. Datadog receives neither, so the Billing UX board
cannot show where a billing attempt started. Three entries emit nothing
anywhere: the inactive-member dialog, the out-of-credits banner and the
credits precondition. 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. 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. 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`. Opening the Stripe portal, failing to open it
and coming back were not recorded on either host. A portal failure
reached error reporting only, and what the customer does inside the
portal never reaches the browser, so the trip itself is the only signal.

## Root cause

(1) `DatadogRumTelemetryProvider` implements only the typed
`trackBillingEvent`, and the paywall and add-credits trackers are legacy
methods it never had. There was no typed event for either, and three
entries never called a tracker. (2) `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. (3) `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. (4) The legacy `trackSubscriptionCancellation` stages
(`flow_opened`, `abandoned`, `failed`) have no typed counterpart, and
the stage `abandoned` was not part of the billing vocabulary. (5) No
event existed for the portal: `accessBillingPortal` and the billing web
portal views opened Stripe and swallowed or reported the result without
a billing event.

## How

**Part 1, entry events (was Comfy-Org#19815)**

- **Contract.** A new `entryEvent.ts` in
`packages/account-core/src/core/billing/telemetry` defines operation
`entry` with stages `paywall_shown` and `add_credits_clicked`, outcome
`pending`. `paywall_shown` carries `current_tier` (bounded: the five
tier keys plus `team`). Both carry the optional `payment_intent_source`.
One line in the `BillingTelemetryEvent` union, one allowlist field
(`current_tier`), two names in `BILLING_TELEMETRY_EVENTS`.
- **E1.** `useSubscriptionDialog` reports `paywall_shown` for every
pricing dialog variant and for the inactive-member dialog. The source is
the one the dialog already hands to checkout (`paymentIntentSource ??
reason`).
- **E2.** `dialogService.showTopUpCreditsDialog` reports
`add_credits_clicked` on its first line, before the capability read. The
source is `options.source`, or `out_of_credits` when the caller says
`isInsufficientCredits`. This covers every entry that opens the top-up
dialog, including the banner and the credits precondition.
- **Datadog parity.** The provider needed no change: both events go
through `trackBillingEvent`, so Datadog builds the action and payload
from the shared builder and stamps `billing_surface: cloud_app`. PostHog
and the desktop sink receive the same events through the same method.
- **Legacy events.** `trackSubscription('modal_opened')`,
`trackAddApiCreditButtonClicked` and their sinks are untouched. A test
with a legacy provider beside the Datadog provider proves the paywall
legacy event still arrives once.

**Part 2, source fidelity (Comfy-Org#19816, merged here)**

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

**Part 3, top-up amount and preset (Comfy-Org#19817, merged here)**

- **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`.

**Part 4, cancel flow (Comfy-Org#19818, merged here)**

- **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`.

**Part 5, portal events (Comfy-Org#19944, merged here)**

- **Contract.** `portalEvent.ts` in
`packages/account-core/src/core/billing/telemetry` defines operation
`portal` with stages `opened`, `failed` and `returned`, and
`BillingPortalTarget` (`payment_methods`, `invoices`,
`manage_subscription`). One line in the `BillingTelemetryEvent` union,
three names in `BILLING_TELEMETRY_EVENTS`, and `target` as a required
allowlist field.
- **Cloud app.** `createBillingPortalReporter` reports the open, the
failure (a blocked tab as `redirect` with `payment_popup_blocked`, other
errors through `describeBillingFailure`) and the first return to the
tab, on the same return signal as the billing refresh. Only the latest
open waits for a return. Personal Manage subscription and Invoice
history report `billing_client: legacy`; workspace Manage subscription
reports the rail that answered and omits `billing_client` on a thrown
failure.
- **Billing web.** `usePaymentPortal` holds the portal logic of
`PaymentMethodsPanel` and `InvoicesView`. The invoices page now gets the
`portal=return` marker and strips it.
- **Out of scope.** The plan-change portal in `PricingTable` (its
operation events cover it), the payment recovery portal in
`useSubscriptionCheckout`, and the hosted billing web tab that workspace
Manage subscription opens (that is `billing.web_handoff.opened`).

## Review Focus

- FE-3140 (Comfy-Org#19798) is
merged into main (`a8337f39a4`) and the base of this PR is main. Five
parts in one PR: they were opened as
Comfy-Org#19815,
Comfy-Org#19816,
Comfy-Org#19817,
Comfy-Org#19818 and
Comfy-Org#19944, stacked, and
parts 2 to 5 were merged into this branch after Christian approved each
at its own head; this PR carries all five against main. It is a sibling
of the FE-3117 part 3
(Comfy-Org#19811) and FE-3118
(Comfy-Org#19819) PRs, which
touch shared contract files only by adding separate lines.
- Merged with the moved FE-3140 base (`cbbe1c4568`): the SDK operation
mapper moved to `@comfyorg/account-core/billing` as
`operationLifecycleEvent.ts` while part 2 added an optional
`paymentIntentSource` argument to it. That argument now imports
`PaymentIntentSource` from `./vocabulary.js` (the app-side import did
not resolve inside the package) and a new test covers it, since the old
app-side mapper test went away with the move. No other base test needed
changing.
- Part 1: E2 sends the entry as `payment_intent_source`, not `source`.
The Notion catalog names the field `source`, but every other billing
event uses `payment_intent_source` for this list, and `source` already
means the resubscribe surface in the allowlist.
- Part 1: E2 fires at `showTopUpCreditsDialog`, so it also fires when
the dialog then falls back to the pricing table or the member notice.
The legacy click event is gated in the deep link and the agent paywall
(only when the user can top up); the new event is not. A deep-link
visitor who cannot top up now produces `add_credits_clicked` followed by
`paywall_shown`, both with the same source.
- Part 1: Until part 2 lands, the popover, the credits tile, the
settings panel, the deep link and the banner call the dialog with no
source, so their E2 carries none. Part 2 passes it.
- Part 1: `outcome` is `pending`, as for `web_handoff`: an entry is a
client journey observation and claims no operation outcome.
- Part 1: `current_tier` is bounded where the legacy `current_tier` was
a free lowercase string: `TEAM` becomes `team`, `ENTERPRISE` and an
unknown tier are omitted.
- Part 1: Not covered: the insufficient-credits member notice that
`showTopUpCreditsDialog` opens for a member who cannot top up. The
ticket names the inactive-member dialog only.
- Part 1: PostHog and the desktop host now also receive
`billing.entry.*` next to the legacy names, so a PostHog funnel can use
either.
- Part 1: No user-visible change: the diff adds telemetry calls only. No
dialog, prop or code path changes.
- Part 2: 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.
- Part 2: 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.
- Part 2: 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.
- Part 2: 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.
- Part 2: 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.
- Part 2: 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.
- Part 2: 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.
- Part 3: `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.
- Part 3: 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.
- Part 3: 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.
- Part 3: The recovered legacy top-up success (credits tile, usage
table) has no start event in that tab and still carries no amount.
- Part 3: The legacy PostHog, Mixpanel and GTM purchase-click event is
untouched.
- Part 3: No user-visible change: the diff adds telemetry fields and
replaces two local constants with the shared list.
- Part 4: 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.
- Part 4: `outcome` for `abandoned` is `pending`, so a dashboard that
counts `outcome: success` and `outcome: failure` is not moved by
customers who leave.
- Part 4: 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.
- Part 4: 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.
- Part 4: 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.
- Part 4: No user-visible change: the diff adds telemetry calls, a plan
helper and a moved function. No dialog, copy or code path changes.
- Part 4: 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 (`INTERNAL ASSERTION FAILED: Expected
a class definition`, local Node 24 against engine 26). This diff does
not touch it.
- Review fixes after CodeRabbit (`e1ba955394`, red tests first): a
fallback dialog opened after the customer confirmed in the provider flow
no longer reports `billing.cancel.abandoned` (the fallback receives
`flowAlreadyConfirmed`), and a native fallback that cannot open after a
confirmed cancel reports `billing.cancel.failed` with `rendering` (the
reporter drops the expectation that an operation follows once the
provider session fails, via `sessionFailed()`). The other cancel
sequences are unchanged.
- Merged with main after Comfy-Org#19921 (`b91f4e77d2`, wait for the workspace
type instead of falling back to legacy billing). Two hunks met part 5
and part 2. `manageSubscription` keeps the portal telemetry and takes
main's rule: a `WORKSPACE_BILLING_REQUIRED` refusal is reported as
`billing.portal.failed` and rethrown for the legacy adapter to recover,
any other failure is reported and not thrown. Invoice history keeps its
error wrapper. The top-up dialog takes main's chooser (only `legacy`
opens the legacy content, `unknown` opens the workspace content) and
keeps part 2's full props, since the legacy content now declares
`source`.

## AS IS / TO BE

**Part 1, entry events**

AS IS: ![AS IS at ce06a6f: 22 of 23 scenarios off contract.
showPricingTable and showTopUpCreditsDialog report no billing.entry
event to Datadog RUM addAction, PostHog capture or the desktop host
sink: 7 of 8 paywall scenarios reach PostHog and the desktop sink with
only the legacy app:subscription_required_modal_opened, the read-only
member dialog reaches nothing, none of the 7 add-credits scenarios
reaches any sink, and of 7 real callers 5 send only the legacy
app:add_api_credit_button_clicked while the agent paywall precondition
and the out-of-credits banner send nothing; this PR's new tests fail as
expected (7 of 19 in dialogService.topUpCredits.test.ts, 7 of 59 in
useSubscriptionDialog.test.ts, 1 of 3 in entryEvent.test.ts); root
changed test files plus src/platform/telemetry pass 661 of 675,
account-core src/core/billing 600 of
601](https://github.com/user-attachments/assets/3f5baa0d-dcef-4178-8e85-e11ca701b3b5)

TO BE: ![TO BE at 91a0b81: 23 of 23 scenarios on contract. The same
paths now report billing.entry.paywall_shown and
billing.entry.add_credits_clicked with one payload to
datadogRum.addAction, posthog.capture and the desktop host sink (the two
cloud providers add billing_surface cloud_app), the legacy modal_opened
and add-credits events still reach PostHog and the desktop sink beside
them, the read-only member dialog emits only the new event, paywall
current_tier is free, standard, creator, founder or team with ENTERPRISE
and an unknown plan omitted where the legacy event sends the raw tier,
the add-credits click carries deep_link, agent_paywall or out_of_credits
and no source for the 6 callers that pass none until part 2, and the 85
billing events recorded across 244 harness tests hold only current_tier,
duration_ms, outcome and payment_intent_source with bounded values, no
email, URL, secret or free-form text; root changed test files plus
src/platform/telemetry pass 675 of 675, account-core src/core/billing
601 of
601](https://github.com/user-attachments/assets/fa4d12e2-32ac-4697-b1f0-9d0eec80049e)

**Part 2, source fidelity**

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)

**Part 3, top-up amount and preset**

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)

**Part 4, cancel flow**

AS IS: ![AS IS at 5e5c096: 16 of 16 scenarios off contract. The
provider cancel flow and the native cancel dialog report no
billing.cancel.intent, abandoned or failed to datadogRum.addAction,
posthog.capture or the desktop host sink in any of the 14 flow
scenarios: only the legacy app:subscription_cancel_flow_opened,
confirmed, abandoned and failed reach PostHog and the desktop sink (with
end_date and, on failure, error_message) and Datadog receives nothing, a
confirmed workspace cancel shows only its billing.operation.started, and
billing.operation.failed on failure, with no intent before them, so the
dismissed flow, the accepted discount, the provider failure with the
native dialog and with the native dialog failing, and the legacy rail
failure all end without a typed cancel event; this PR's new tests fail
as expected (7 of 32 in launchCancellationFlow.test.ts, 7 of 27 in
CancelSubscriptionDialogContent.test.ts, billingPlanTelemetry.test.ts
fails to load); root changed test files plus src/platform/telemetry pass
654 of 668, account-core src/core/billing 611 of 611 because its
cancelEvent.test.ts only exercises the generic
builders](https://github.com/user-attachments/assets/31de0750-8239-44ff-a4b3-993354b3e3c2)

TO BE: ![TO BE at f1760c9: 16 of 16 scenarios on contract.
billing.cancel.intent reaches datadogRum.addAction, posthog.capture and
the desktop host sink where the legacy flow_opened fires, then a
dismissed flow adds billing.cancel.abandoned, an accepted discount stops
at intent, a confirmed cancel stops at intent on both flows with the
unchanged billing.operation.started and failed events of the workspace
request next to it and no abandoned or failed from the reporter, a
provider failure with the native dialog stops at intent, a provider
failure with the native dialog failing to open adds
billing.cancel.failed with failure_category rendering, and a legacy rail
failure adds billing.cancel.failed with unknown and no
billing.cancel.abandoned after it; the new events carry only outcome,
current_tier, cycle and failure_category while the legacy events keep
end_date and error_message, and the Datadog actions carry
billing_surface cloud_app; the 343 billing events recorded across 325
harness tests hold 17 allowlisted keys with bounded values and ids, no
email, URL, secret or free-form text; root changed test files plus
src/platform/telemetry pass 681 of 681, account-core src/core/billing
611 of
611](https://github.com/user-attachments/assets/fb14feba-c567-4a09-a8b8-1e35ef9b0f79)

**Part 5, portal events**

Captured through the real telemetry providers in the component and
composable tests (Datadog RUM action and PostHog event carry identical
payloads, `billing_surface` per host). AS IS = the FE-3115 branch before
part 5, TO BE = after.

| Path | Host | AS IS | TO BE |
| --- | --- | --- | --- |
| reports manageSubscription opening the portal and one return |
cloud_app | nothing | `billing.portal.opened` (target:
manage_subscription, billing_client:
legacy)<br>`billing.portal.returned` (target: manage_subscription,
billing_client: legacy) |
| reports handleInvoiceHistory opening the portal and one return |
cloud_app | nothing | `billing.portal.opened` (target: invoices,
billing_client: legacy)<br>`billing.portal.returned` (target: invoices,
billing_client: legacy) |
| reports manageSubscription as a failed open when the tab is blocked |
cloud_app | nothing | `billing.portal.failed` (target:
manage_subscription, billing_client: legacy, failure_category: redirect,
error_code: payment_popup_blocked) |
| reports handleInvoiceHistory as a failed open when the tab is blocked
| cloud_app | nothing | `billing.portal.failed` (target: invoices,
billing_client: legacy, failure_category: redirect, error_code:
payment_popup_blocked) |
| reports a refused portal request as a failed open and still reports
the error | cloud_app | nothing | `billing.portal.failed` (target:
manage_subscription, billing_client: legacy, failure_category:
api_rejected) |
| reports the portal opening from the SDK rail and one return |
cloud_app | nothing | `billing.portal.opened` (target:
manage_subscription, billing_client: sdk)<br>`billing.portal.returned`
(target: manage_subscription, billing_client: sdk) |
| reports the portal opening from the workspace client and one return |
cloud_app | nothing | `billing.portal.opened` (target:
manage_subscription, billing_client:
legacy)<br>`billing.portal.returned` (target: manage_subscription,
billing_client: legacy) |
| reports a blocked portal tab as a failed open | cloud_app | nothing |
`billing.portal.failed` (target: manage_subscription, failure_category:
redirect, error_code: payment_popup_blocked) |
| reports a refused portal request as a failed open | cloud_app |
nothing | `billing.portal.failed` (target: manage_subscription,
failure_category: api_rejected) |
| reports the portal opening on the invoices | billing_web | nothing |
`billing.portal.opened` (target: invoices, billing_client: sdk) |
| reports the portal opening on the payment methods | billing_web |
nothing | `billing.portal.opened` (target: payment_methods,
billing_client: sdk) |
| reports a portal it could not open as a failed open | billing_web |
nothing | `billing.portal.failed` (target: payment_methods,
billing_client: sdk, failure_category: api_rejected) |
| reports the return from the portal once and drops the marker |
billing_web | nothing | `billing.portal.returned` (target: invoices,
billing_client: sdk) |
| reports the return from the portal once | billing_web | nothing |
`billing.portal.returned` (target: payment_methods, billing_client: sdk)
|
| reports a request that never reached the server as a failed portal
open | billing_web | nothing | `billing.portal.failed` (target:
invoices, billing_client: sdk, failure_category: network) |
| reports a refusal from the server as a failed portal open |
billing_web | nothing | `billing.portal.failed` (target: invoices,
billing_client: sdk, failure_category: api_rejected) |
| reports a portal address that fails validation as a failed portal open
| billing_web | nothing | `billing.portal.failed` (target: invoices,
billing_client: sdk, failure_category: unknown) |

The evidence has five parts, one per part of the change: the events each
cloud entry, source, top-up, cancel and portal path reports to Datadog
RUM, PostHog and the desktop sink, before and after.

## 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](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 | this PR |
| 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), merged
|
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| 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 | [PR
19944](Comfy-Org#19944), merged
into this PR |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | specified, blocked on
PostHog key scopes |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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
```

---------

Co-authored-by: GitHub Action <action@github.com>
laurigates pushed a commit to laurigates/ComfyUI_frontend that referenced this pull request Oct 3, 2026
… it (Comfy-Org#19947)

## Summary

Report a hosted step the customer is sent to and the return from it, on
the cloud app and billing web (E23).

## Why

A hosted redirect unloads the page, so the operation's start stayed open
with nothing to say the customer left for Stripe or the billing app.
Without a start and a return, a customer who never came back looks the
same as one the browser lost.

## How

A new contract module checkoutRedirectEvent.ts adds
billing.checkout.redirect_started and billing.checkout.returned (one
union line). Fields are destination (stripe or billing_web), step
(authentication, payment_method, invoice_payment or checkout, read from
what the server waits on), navigation (redirect or new_tab) and optional
method_kind. destination, step, navigation and method_kind join the
allowlist. The lifecycle gains reportHostedStepOpened(operationId,
navigation, methodKind?). It emits redirect_started. For a redirect it
stores the step in the operation pointer, so the page the customer lands
on reports returned once when it recovers the operation. Rewriting the
pointer drops the marker, so a reload does not count it again. For a new
tab it reports returned on the next wake. usePaymentAttempt reports the
hosted step before it hands the URL to the host, so the event is queued
before the page unloads. It also reports an embedded challenge as a
redirect when the host says the method is not a card, because Stripe
finishes Alipay and similar methods on their own site. The billing web
full-page checkout passes the method of its own Pay. The cloud SDK store
reports a hosted page it opened in a new tab. There is no user-visible
change.

## Review Focus

- The redirect marker in the operation pointer schema, and that adoption
rewrites the pointer without it.
- Reporting before openUrl is deliberate. Datadog RUM flushes on
beforeunload and visibilitychange, and PostHog drains its queue by
beacon on pagehide, so an event queued before location.assign is sent.
- The off-site challenge rule in usePaymentAttempt: a required challenge
plus a non-card method kind is reported as a redirect.
- BillingOperationTelemetryEvent is now a discriminated union, so a
redirect event cannot be built without destination, step and navigation.
- Known gaps: method_kind is only known for a non-card Pay on the
billing web full-page checkout. The legacy cloud subscribe path that
calls window.open directly is not covered. A return after a same-tab
redirect that lands on a page with no pointer storage is not reported.

## AS IS / TO BE

Telemetry change, so the evidence is the captured events instead of a
screenshot: the real SDK lifecycle and the billing web checkout with
only the network edge and the telemetry SDKs (Datadog RUM, posthog-js)
stubbed. AS IS = origin/main, TO BE = this stack.

| Path | AS IS | TO BE |
| --- | --- | --- |
| E23 same-tab redirect | page that left: `started`; page it came back
to: `started`, `succeeded` | left: `redirect_started` (destination
stripe, step payment_method, navigation redirect, method_kind alipay);
came back: `returned` with the same fields, `resumed: true` |
| E23 new tab | `started` only | `redirect_started` then `returned` on
the next wake (navigation new_tab) |

No payload carries an email, URL, client secret, promo code or provider
id; every new field is a bounded enum.

evidence-fe3119/as-is-lifecycle.json shows the redirect and new-tab
scenarios sending only billing.operation.started and succeeded on main,
and to-be-lifecycle.json shows redirect_started on the page that left,
returned with the same step and method on the page it came back to, and
the new-tab pair, for both surfaces.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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) (four
parts), 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) merged,
billing web cancel [PR
19945](Comfy-Org#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| 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 | [PR
19944](Comfy-Org#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | specified, blocked on
PostHog key scopes |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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 T9 stroke-width:3px
```
theluckystrike pushed a commit to theluckystrike/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…urney with no operation (Comfy-Org#19975)

## Summary

Report where a customer left a cloud app checkout dialog when the
journey has no operation yet (E24, cloud app follow-up).

## Why

Billing web reports billing.checkout.abandoned, but the cloud app did
not. A customer who closed the subscription or top-up dialog, or closed
the tab with it open, left no trace of where they stopped. The abandon
KPI itself is derived on the dashboard from journeys that never link an
operation. This event only says where the customer left.

## How

A new module, checkoutJourneyTelemetry.ts, becomes the one way the cloud
app reports a journey phase. It remembers the last progress phase this
tab reported on the active journey. reportCheckoutJourneyExit reports
billing.checkout.abandoned with last_phase and exit only when the active
journey has no billing_op_id, and only once per stretch of new progress.
A close and a later pagehide therefore report once, and a reopened
journey reports again only after a new phase. useCheckoutJourneyExit
wires it into useSubscriptionCheckout and the top-up dialog: scope
dispose reports exit dialog_close, and pagehide while the dialog is open
reports exit page_exit. A hand-off to the hosted billing web checkout
marks the journey as accounted for, so that close reports nothing. The
shared CheckoutExit enum gains dialog_close. The cloud PostHog provider
sends an abandoned page_exit with transport sendBeacon and
send_instantly, through its existing teardown capture. Everything else
stays batched. billing_surface cloud_app comes from the existing cloud
journey payload. There is no user-visible change.

## Review Focus

- Base: the -3 branch was squash-merged into -2 (8814fe1), so this
branch is cut from -2 and merges origin/main. Its PR targets -2.
- The event is an exit observation with no outcome. Once an operation is
bound, the cloud app reports nothing. The operation events and the
server own the end.
- The last phase is tab-scoped, module-level state. A journey resumed
after a reload with no new phase in this tab reports no exit.
- The three call sites (useSubscriptionCheckout,
SubscriptionAddPaymentPreviewWorkspace,
TopUpCreditsDialogContentWorkspace) now go through
trackCheckoutJourneyPhase. Their existing journey tests pass unchanged.
- Known gaps: the brief says later phase events carry resumed: true, but
cloud journey events have no resumed field, and this branch does not add
one. A tab closed while it was already in the background may not flush
its RUM action. PostHog events captured before it loads are not queued
for page_exit, the same as the agent panel teardown event. The hosted
handoff for the subscription intent (manage plan) is not a checkout
journey and is untouched.

## AS IS / TO BE

Telemetry change, so the evidence is the captured events instead of a
screenshot: the real cloud dialogs and journey module with the Datadog
RUM and PostHog providers, only the network edge and the telemetry SDKs
stubbed. AS IS = origin/main, TO BE = this branch.

| Scenario | AS IS | TO BE |
| --- | --- | --- |
| T1 top-up dialog closed after `entered` | `entered` | adds `abandoned`
(last_phase entered, exit dialog_close) |
| T2 tab closed with the top-up dialog open | `entered` | adds
`abandoned` (exit page_exit); PostHog sends with `{transport:
'sendBeacon', send_instantly: true}` |
| T3 top-up closed after a submit that bound no operation | `entered`,
`submitted` | adds `abandoned` (last_phase submitted, exit dialog_close)
|
| T4 top-up closed, then tab closed, after the operation was bound |
`entered`, `submitted`, `operation_linked` | unchanged, no abandon |
| T5 top-up closed, then tab closed | `entered` | one `abandoned`
(dialog_close), no second report on pagehide |
| T6 top-up closed, reopened (journey resumed), closed | `entered` | one
`abandoned`; the reopen made no new phase, so its close reports nothing
|
| S1 subscription dialog closed at the quote | `entered`,
`preview_ready` | adds `abandoned` (last_phase preview_ready, exit
dialog_close) |
| S2 tab closed at the quote | `entered`, `preview_ready` | adds
`abandoned` (exit page_exit), PostHog by sendBeacon |
| S3 subscription closed after the quote failed | `entered`,
`preview_failed` | adds `abandoned` (last_phase preview_failed) |
| S4 subscription closed, then tab closed, after the operation was bound
| through `operation_linked` | unchanged, no abandon |
| S5 dialog closed because the hosted checkout tab opened | `entered` |
unchanged, no abandon (billing web continues the journey) |
| S6 closed at the quote, reopened idle and closed, tab hidden, reopened
to the quote and closed | 2x `preview_ready` | one `abandoned` per
stretch of new progress: 2, not 4 |

The event is an exit observation (decision D13 in the plan): the
headline abandon count is derived on the dashboard from journeys with no
`operation_linked` within the journey TTL.

evidence-fe3119-cloud-abandon/as-is.json shows no abandoned event on
origin/main for any path, and to-be.json shows abandoned with last_phase
and exit to RUM and PostHog on dialog close at entered, submitted,
preview_ready and preview_failed, sendBeacon on page exit, one report
for close plus pagehide and for reopen without progress, and nothing
after a bound operation or a hosted handoff.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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) (four
parts), 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) merged,
billing web cancel [PR
19945](Comfy-Org#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| 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 | [PR
19944](Comfy-Org#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | [first
cut](https://us.posthog.com/project/204330/dashboard/2164447) created |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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 T9 stroke-width:3px
```
theluckystrike pushed a commit to theluckystrike/ComfyUI_frontend that referenced this pull request Oct 3, 2026
…embedded checkout (Comfy-Org#19974)

## Summary

Report an abandoned checkout and the ending screen on the billing web
embedded checkout, the same way the full-page checkout does (E24, E25).

## Why

The full-page checkout reports billing.checkout.abandoned and
billing.checkout.ended since Comfy-Org#19948, but the embedded CheckoutView
reported neither. A customer who closed the tab or went back from the
embedded checkout left no trace, and its success and refusal screens
could not be told apart in a funnel.

## How

CheckoutView reuses the journey's abandoned and ended methods from
useCheckoutJourney and the beacon transport the facade already applies
to abandoned. No shared composable was extracted, because the two views
share only the journey, which is already shared, and their ending
screens differ. It reports abandoned with exit page_exit on pagehide,
and with exit back or close from those controls. It reports no abandon
after the page handed itself to a hosted step, or while a Pay with a
non-card method is in flight, since that method pays on its own site. It
reports ended with ending_kind success when the success step shows:
attribution started when this page's Pay returned the result, followed
when the page recovered an operation it did not send. It reports ended
when the quote failure screen shows, right after preview_failed: refused
for ACCESS_DENIED, plan_unavailable for the server code INVALID_PLAN,
and load_failed otherwise. The journey keeps its existing rules:
abandoned at most once and never after an ending, and each ending kind
once. There is no user-visible change.

## Review Focus

- quoteFailureEndingOf maps the embedded quote failure screen onto the
full-page ending kinds. The embedded view has no capability read, so
refused comes from ACCESS_DENIED on the quote, not from a denial reason.
- payingOnOwnSite is true only between the Pay press and the command
settling, for a method type other than card. A card Pay in flight when
the tab closes is still an abandon, as on the full page.
- Success attribution reads checkout.result: an ok result means this
page's own Pay, and none means a recovered operation.
- Two existing tests now expect billing.checkout.ended: the full journey
test, and the stream ordering test, where ended lands before
billing.subscription_checkout.succeeded because the success step shows
before the attempt reports its terminal.
- Known gaps: a quote that allows no change (allowed false) shows no
ending screen on the embedded view, so it reports preview_failed and no
ended. A saved non-card method carries no method type, so a redirect
from it would count as an abandon. That matches the full page. The
background-tab flush gap from Comfy-Org#19948 applies here too.

## AS IS / TO BE

Telemetry change, so the evidence is the captured events instead of a
screenshot: the real `CheckoutView` with the billing web telemetry
facade and PostHog started, only the fake billing client and the
telemetry SDKs stubbed. AS IS = origin/main, TO BE = this branch.

| Path | AS IS | TO BE |
| --- | --- | --- |
| Tab closed at the quote | `entered`, `preview_ready` | adds
`abandoned` (last_phase preview_ready, exit page_exit). The PostHog copy
is sent with `{transport: 'sendBeacon'}` |
| Back control, then the page unloads | `entered`, `preview_ready`,
`web_return.clicked` | adds `abandoned` (exit back) once. The later
pagehide adds nothing |
| Close control, then the page unloads | `entered`, `preview_ready`,
`web_return.clicked` | adds `abandoned` (exit close) once |
| Hosted redirect (server offers a continuation) | `entered`,
`preview_ready` | unchanged. No abandon, because the page handed itself
to the hosted step |
| Alipay Pay leaving for its own site | no abandon | unchanged. No
abandon while a non-card Pay is in flight |
| Own payment succeeds, then the tab closes | no ending event | `ended`
(ending_kind success, attribution started, billing_op_id op_9). No
abandon after it |
| Quote refused (ACCESS_DENIED), then Back | `entered`,
`preview_failed`, `web_return.clicked` | adds `ended` (ending_kind
refused), with no attribution. Back after it adds no abandon |

No new field carries an email, URL, client secret, promo code or
provider id; every new field is a bounded enum.

evidence-fe3119-embedded/as-is.json shows no abandoned or ended event on
the embedded checkout on main. to-be.json shows abandoned with
last_phase and exit for tab close, Back and Close, sent to RUM and to
PostHog with transport sendBeacon. It shows no abandon for a hosted
redirect or an Alipay Pay, and ended with ending_kind and attribution
for the success and refusal screens.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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) (four
parts), 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) merged,
billing web cancel [PR
19945](Comfy-Org#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| 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 | [PR
19944](Comfy-Org#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | [first
cut](https://us.posthog.com/project/204330/dashboard/2164447) created |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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 T9 stroke-width:3px
```
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 4, 2026
…tion switch rewrites the operation pointer (Comfy-Org#20004)

## Summary

Keep the saved hosted redirect when a presentation switch rewrites the
operation pointer, so billing.checkout.returned (E23) is still reported
on the page the customer comes back to.

## Why

CodeRabbit found this on Comfy-Org#19975
(Comfy-Org#19975 (comment)).
A same-tab hosted redirect is only reported as returned if the tab's
operation pointer still carries the redirect when the next page recovers
the operation. A presentation switch after the redirect erased it, so
that return was never reported.

## Root cause

writePointer rebuilds the pointer from the operation state and only
includes redirect when the caller passes one. reportHostedStepOpened
passes it, but switchPresentation rewrites the pointer for the same
operation without it, so the saved redirect is dropped.

## How

A small savedRedirect helper reads the current pointer and returns its
redirect only when its operationId is the operation being written.
switchPresentation passes that to writePointer. The adopt write is
deliberately left unchanged: adoption is where a saved redirect is
turned into billing.checkout.returned, so it must consume the redirect.
Carrying it forward there would report returned again on every reload,
which the existing 'reports the return once' test catches. There is no
user-visible change.

## Review Focus

- The carry-forward lives at the switchPresentation call site, not
inside writePointer. A generic carry-forward in writePointer also hits
the adopt write and breaks the 'reports the return once' contract. This
was checked: that test fails with the generic version.
- The operationId guard matters when two operations are live in one
scope. The new 'reports no return for an operation that never
redirected, though another one did' test fails if the guard is removed.
- leftScope writes a fresh pointer for a newly issued operation through
pointers.write directly. It has no redirect to keep and is unchanged.

## AS IS / TO BE

Telemetry change, so the evidence is the captured lifecycle events
instead of a screenshot. Scenario: embedded 3DS top-up, hosted redirect,
`switchPresentation('op-1', 'hosted')`, unload, then recover on a new
page.

| | Pointer after the rewrite | Events on the page the customer returns
to |
| --- | --- | --- |
| AS IS (main) | `redirect` dropped | `billing.operation.started`,
`billing.operation.succeeded` |
| TO BE | `redirect` kept | adds `billing.checkout.returned` (navigation
redirect, step authentication, method_kind card, presentation hosted,
resumed true) on both the cloud app and billing web payloads |

evidence-fe3119-pointer/as-is.json shows the pointer losing redirect
after the same-operation rewrite and no billing.checkout.returned on the
page returned to, and to-be.json shows redirect kept and
billing.checkout.returned reported to both cloud app and billing web
payloads.

## Where this sits in the plan

Linear: [FE-3119](https://linear.app/comfyorg/issue/FE-3119), 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), merged
|
| 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) merged,
billing web cancel [PR
19945](Comfy-Org#19945) in
review |
| T8 | FE-3118 | Billing web journey and choices | [PR
19819](Comfy-Org#19819) (three
parts), merged |
| T9 | FE-3119 | Payment friction events | this PR |
| 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 | [PR
19944](Comfy-Org#19944), in
review |
| T12 | FE-3122 | Flag coverage check | [PR
19942](Comfy-Org#19942), in
review |
| T13 | FE-3123 | PostHog rollout dashboard | [first
cut](https://us.posthog.com/project/204330/dashboard/2164447) created |
| T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard |
[comfy-infra PR
1597](Comfy-Org/comfy-infra#1597), in review |
| T4+ | FE-3162 | Move the payload-helper tests to account-core | [PR
19940](Comfy-Org#19940), in
review |
| T10+ | FE-3158 | Billing web Try again after session creation fails |
[PR 19941](Comfy-Org#19941), in
review |
| 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 T9 stroke-width:3px
```
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