Repository navigation
FE-3118 feat(billing-web): report the checkout entry and quote preview in the cloud journey phases - #19819
Conversation
…to account-core The typed billing event union, its payload allowlist, the payload builders and the billing event-name constants now live in @comfyorg/account-core/billing so billing web can import them. src/platform/telemetry/types.ts re-exports the moved names until the cloud imports are migrated.
…o account-core The journey phases, their wire names and payload builder share their failure vocabulary with the billing event union, so billing web needs them from the same package to type the billing.checkout events.
…ount-core Migrates every cloud import of the moved contract to @comfyorg/account-core/billing and deletes the re-exports from src/platform/telemetry/types.ts. TelemetryEvents spreads the shared billing event names, TierKey and BillingCycle derive from the shared vocabulary, and the telemetry failure type is now BillingTelemetryFailure.
…the allowlist getBillingWebTelemetryEventPayload builds the allowlisted payload and claims the billing_web surface, as the cloud app builder claims cloud_app. Tests cover both builders dropping every field outside the allowlist, a table that fails to compile when an event field has no handling, and a type test in billing-contract that fails when the event vocabulary drifts from the entry URL contract.
…try facade trackBillingEvent takes a BillingTelemetryEvent, builds its allowlisted payload through the shared billing web builder, which claims billing_surface billing_web, and sends it to RUM and PostHog as before. The event name comes from the event, so a caller can no longer pair a name with another operation's payload or send a field the privacy contract does not allowlist.
…emetry event name TelemetryEventName now includes BillingTelemetryEventName, so adding a member to the shared BillingTelemetryEvent union no longer needs a matching TelemetryEvents constant to keep the cloud sinks compiling.
…iew from both checkouts
…19804) ## Summary Billing web reports how an entry link arrives, once per tab entry: `billing.web_entry.received`, `.rejected` and `.bounced` (E4 to E6). This is the first of three PRs for FE-3120. Session events (E7 to E9) and the return click (E27) follow in the next two. ## Why Nothing records what reaches billing web. A link that fails to parse, a pricing or plan-less checkout link that sends the customer straight back to the host, and a checkout whose return target was replaced are all invisible. The rollout needs the landing as a countable step that links to the cloud app's handoff, and it must count a customer once, not once per route change. ## Root cause The router guard reads and routes every entry link but reports nothing, and billing web has no way to say "this tab already reported". The guard runs on every navigation, on the sign-in redirect and on every reload, so a naive emit would repeat. ## How - **Contract.** `webEntryEvent.ts` in `packages/account-core/src/core/billing/telemetry` defines the three events as one `WebEntryBillingEvent` and adds one line to the `BillingTelemetryEvent` union. The payload allowlist gains `product`, `has_plan`, `reason` and `to`. All are bounded enums or a boolean. `WebEntryProduct`, `WebEntryErrorCode` and `WebEntryBounceTarget` mirror the billing-contract types, and type tests in `packages/billing-contract` fail when they drift. - **Once per tab.** `trackOncePerTab` sends an event the first time the tab produces its name. It remembers in `sessionStorage`, which survives a reload and ends with the tab. A tab that refuses storage still reports once per page load. - **Router.** The guard reports `received` when it admits a link, `rejected` with the parser's `error_code` when it cannot use one (including a link whose way back cannot be resolved), and `bounced` when it sends the customer to the host or replaces a checkout's `return_to`. - **Payloads.** `received` carries `intent`, `product`, `has_plan`, the link's `payment_intent_source` and its `correlation_id` (the cloud journey id) when present. `bounced` carries `reason` (`pricing_link`, `planless_checkout`, `return_target_rewritten`) and `to` (a return target or `pricing_table`). No URL, query value, workspace id, promo code or amount is reported. - **Docs.** A short subsection in the billing web README lists the events. - **User-visible behavior.** None. This is telemetry only. ## Review Focus - Stacked on #19798 (FE-3140): the base is its branch until it merges, then the base moves to main. Review only the commits after FE-3140's head `c24ff3de75`. Next in this stack: the session events (E7 to E9) and the return click (E27). - Field name: `received` sends the link's source as `payment_intent_source`, not `source`, the same call E3 made. `source` already means the resubscribe surface in the allowlist, and every other billing event uses `payment_intent_source` for this list. - Disjoint outcomes: `received` means admitted, `rejected` means the error view, `bounced` means the customer left for the host. A pricing link or plan-less checkout that bounces is not also `received`. The one overlap is `return_target_rewritten`, which follows `received` because the link is still served. - `outcome` is `pending` on all three. The SSOT says client journey events never claim an operation outcome, so a rejected link is `stage: rejected` with `error_code`, not `outcome: failure`. Dashboards that filter on `outcome:failure` will not see these. - Once per tab is per event name, not per link. A tab that bounces a pricing link and later rewrites a checkout's return target reports only the first `bounced`. A host that navigates the same tab into billing web twice, instead of opening a new tab, is counted once. Cloud opens a new tab each time. - `UNKNOWN_RETURN_TARGET` can come from a pricing or plan-less link whose return target has no destination in this environment. That link is reported as `rejected`, not `received` then `bounced`. - The planless router test file now mocks the telemetry facade, as the sink boundary, so its cold import stays light. On a heavily loaded machine its first test is close to the default 5s limit for module loading. It passed at normal load. - Known gap: `bounced` leaves the page immediately (`location.replace`). If PostHog has not finished loading when the page leaves, its queued event is lost with the page. Whether RUM flushes on a page exit is part of the FE-3119 check. ## AS IS / TO BE AS IS:  TO BE:  The evidence is the sequence of billing web telemetry events for a valid link, a rejected link, a pricing link, a plan-less checkout and a checkout with a replaced return target, then the same links after a route change and a reload in the same tab, before (no events) and after. ## Where this sits in the plan Linear: [FE-3120](https://linear.app/comfyorg/issue/FE-3120), part of [FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards). Plan, event catalog and dependency graph: [action items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89). | Task | Ticket | What | Status | | --- | --- | --- | --- | | T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT | | T2 | FE-3108 | Decide RUM application and env mapping | decided | | T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR 19688](#19688), merged | | T3+ | FE-3156 | Opaque RUM user id on billing web | [PR 19794](#19794), in review | | T4, F1 | FE-3106 | SDK-rail ownership | [PR 19620](#19620), merged | | T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR 19623](#19623), merged | | T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR 19685](#19685), merged | | T4, F5 | FE-3112 | SDK top-up terminals | [PR 19628](#19628), merged | | T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR 19622](#19622), merged | | T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR 19627](#19627), merged | | T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices | [PR 19686](#19686), merged | | T4+ | FE-3140 | Move the billing event contract to a shared package | [PR 19798](#19798), in review | | T5 | FE-3115 | Cloud entry fidelity and Datadog parity | todo | | T6 | FE-3116 | Handoff contract and event | [PR 19687](#19687), merged | | T7 | FE-3117 | Billing web attempt lifecycle | [PR 19809](#19809), [PR 19810](#19810), [PR 19811](#19811), in review | | T8 | FE-3118 | Billing web journey and choices | todo | | T9 | FE-3119 | Payment friction events | todo | | T10 | FE-3120 | Billing web entry, session and return | this PR | | T11 | FE-3121 | Portal events | todo | | T12 | FE-3122 | Flag coverage check | todo | | T13 | FE-3123 | PostHog rollout dashboard | todo | | T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo | | T15 | FE-3125 | Verification per flow | todo | | T16 | FE-3126 | Rollout plan | todo | ```mermaid flowchart LR subgraph DEC["Decided"] T1["FE-3107 T1 vocabulary"] T2["FE-3108 T2 RUM app and env"] end subgraph FIX["Existing events (T4)"] F1["FE-3106 F1 SDK-rail ownership"] F2["FE-3110 F2 mapper fields"] F3["FE-3111 F3 surface and client"] F5["FE-3112 F5 top-up terminals"] F6["FE-3113 F6 downgrade terminal"] F7["FE-3114 F7 legacy personal, first slice"] F7B["FE-3131 F7 remaining slices"] C140["FE-3140 event contract to shared package"] end subgraph EMIT["New events"] T3["FE-3109 T3 billing web bootstrap"] T3b["FE-3156 T3+ opaque RUM user id"] T5["FE-3115 T5 cloud entry and parity"] T6["FE-3116 T6 handoff contract"] T7["FE-3117 T7 attempt lifecycle"] T8["FE-3118 T8 journey and choices"] T9["FE-3119 T9 friction"] T10["FE-3120 T10 entry, session, return"] T11["FE-3121 T11 portal"] T12["FE-3122 T12 flag coverage"] end subgraph DASH["Dashboards"] T13["FE-3123 T13 PostHog rollout"] T14["FE-3124 T14 Frontend RUM tiles"] end T15["FE-3125 T15 verification"] T16["FE-3126 T16 rollout plan"] T2 --> T3 T3 --> T3b F3 --> C140 T3 --> C140 C140 --> T7 C140 --> T8 C140 --> T10 C140 --> T11 T1 --> F3 T1 --> T5 T1 --> T6 T1 --> T13 T1 --> T14 T2 --> T14 F2 --> T7 T3 --> T7 T3 --> T8 T3 --> T10 T3 --> T11 T3 --> T12 T5 --> T11 T6 --> T8 T6 --> T10 T7 --> T9 T8 --> T9 F1 --> T13 F3 --> T13 FIX --> T15 T5 --> T15 T9 --> T15 T10 --> T15 T11 --> T15 T12 --> T15 T13 --> T15 T14 --> T15 T13 --> T16 T15 --> T16 style T10 stroke-width:3px ```
…-to-a-shared into FE-3118
…he-billing-telemetry-event-contract-to-a-shared
FE-3156's test sent a billing event as a name plus a payload. trackBillingEvent now takes the typed BillingTelemetryEvent, so the test sends a real event and still asserts that RUM carries no user field beyond the id set by startRumUser.
…-to-a-shared into FE-3118
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughBilling-web adds shared checkout journey event contracts and telemetry for embedded and full-page checkout. The changes track entry, quote, payment, promotion, submission, and operation events, and add tests and documentation for event fields and behavior. ChangesCheckout journey telemetry
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CheckoutView
participant useCheckoutJourney
participant billingWebTelemetry
participant RUM
participant PostHog
CheckoutView->>useCheckoutJourney: Report checkout journey phases
useCheckoutJourney->>billingWebTelemetry: Send checkout journey events
billingWebTelemetry->>RUM: Record event
billingWebTelemetry->>PostHog: Capture payload
Suggested reviewers: Merge Risk: 🟡 Moderate · up to Checkout remains usable, but successful mandatory requotes are missing from journey reporting. Fix that telemetry gap before merging unless it is explicitly accepted. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change expands analytics reporting while preserving explicit payload filtering and existing payment controls in the inspected paths. No introduced authorization bypass or sensitive-data disclosure was established. Runtime error values and event correlation during overlapping attempts remain partially understood. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The PR contains bug-fix signals in the commit subjects, including
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🌐 Website E2ETip All tests passed.
🎨 Storybook: ✅ Built — View Storybook🌾 Fallow: ✅ PassedFallow 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 61a0958ba452fecb8d51537634bc65a75f19deed
Full docs: ADR-DEVEX-LINT-0015 🎭 Playwright: ✅ 2187 passed, 0 failed📊 Browser Reports
🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
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: 10.1 MB gzip 🔴 +138 BDetailsSummary
Category Glance App Entry Points — 3.89 kB (baseline 3.89 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.47 MB (baseline 1.47 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 135 kB (baseline 135 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 4 unchanged Panels & Settings — 646 kB (baseline 646 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 18 unchanged User & Accounts — 53.6 kB (baseline 53.6 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 8 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 184 kB (baseline 184 kB) • ⚪ 0 BReusable component library chunks
Status: 8 added / 8 removed / 10 unchanged Data & Services — 4.13 MB (baseline 4.13 MB) • 🔴 +18 BStores, services, APIs, and repositories
Status: 11 added / 11 removed / 3 unchanged Utilities & Hooks — 586 kB (baseline 586 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 20 added / 20 removed / 18 unchanged Vendor & Third-Party — 17.2 MB (baseline 17.2 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 18.3 MB (baseline 18.3 MB) • 🔴 +54 BBundles that do not match a named category
Status: 76 added / 76 removed / 229 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-10-02T02:36:29.862Z",
"gitSha": "6d17b4d462864eed9ec981e6c8079f14af0bd42f",
"branch": "jaewon/fe-3118-billing-web-checkout-journey-and-choice-events",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2041.729000000032,
"styleRecalcs": 9,
"styleRecalcDurationMs": 3.636,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 514.401,
"heapDeltaBytes": -25823868,
"heapUsedBytes": 75456564,
"domNodes": -232,
"jsHeapTotalBytes": -3407872,
"scriptDurationMs": 12.444000000000004,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66557377049181,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2007.3840000000018,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.110999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 445.991,
"heapDeltaBytes": 394036,
"heapUsedBytes": 67059040,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.729000000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760327,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1792.9289999999583,
"styleRecalcs": 75,
"styleRecalcDurationMs": 18.755000000000003,
"layouts": 12,
"layoutDurationMs": 4.6579999999999995,
"taskDurationMs": 822.951,
"heapDeltaBytes": -2919640,
"heapUsedBytes": 63615792,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 165.012,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665420560747663,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1789.7580000000062,
"styleRecalcs": 76,
"styleRecalcDurationMs": 19.067,
"layouts": 12,
"layoutDurationMs": 4.295,
"taskDurationMs": 826.7090000000001,
"heapDeltaBytes": 19522156,
"heapUsedBytes": 73334716,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 167.87099999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66542056074767,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1703.630999999973,
"styleRecalcs": 32,
"styleRecalcDurationMs": 10.032000000000002,
"layouts": 6,
"layoutDurationMs": 1.287,
"taskDurationMs": 356.1019999999999,
"heapDeltaBytes": 25273280,
"heapUsedBytes": 79431564,
"domNodes": 53,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 13.580000000000002,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6656862745098,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1725.1109999999699,
"styleRecalcs": 30,
"styleRecalcDurationMs": 10.288,
"layouts": 6,
"layoutDurationMs": 1.227,
"taskDurationMs": 356.7870000000001,
"heapDeltaBytes": 3458992,
"heapUsedBytes": 70658420,
"domNodes": 53,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 13.006000000000004,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666990291262135,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 711.0119999999824,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.7889999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 457.108,
"heapDeltaBytes": 14564052,
"heapUsedBytes": 68303504,
"domNodes": -230,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 167.957,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 731.1620000000403,
"styleRecalcs": 13,
"styleRecalcDurationMs": 4.544,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 500.18699999999995,
"heapDeltaBytes": -7964532,
"heapUsedBytes": 58802620,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 184.198,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665116279069775,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1190.144000000032,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 872.1790000000001,
"heapDeltaBytes": 14476756,
"heapUsedBytes": 92370448,
"domNodes": 0,
"jsHeapTotalBytes": 6717440,
"scriptDurationMs": 70.149,
"eventListeners": 0,
"totalBlockingTimeMs": 553,
"frameDurationMs": 34.8029411764706,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1172.9349999999386,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 854.3410000000001,
"heapDeltaBytes": 14465740,
"heapUsedBytes": 93207720,
"domNodes": 0,
"jsHeapTotalBytes": 7241728,
"scriptDurationMs": 72.404,
"eventListeners": 0,
"totalBlockingTimeMs": 534,
"frameDurationMs": 34.31176470588234,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 861.7239999999811,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 495.3350000000003,
"heapDeltaBytes": -7406632,
"heapUsedBytes": 90956512,
"domNodes": 0,
"jsHeapTotalBytes": 528384,
"scriptDurationMs": 171.98599999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 228,
"frameDurationMs": 25.488235294117658,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 912.5970000000052,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 504.4789999999999,
"heapDeltaBytes": -7992188,
"heapUsedBytes": 78504812,
"domNodes": 0,
"jsHeapTotalBytes": 1839104,
"scriptDurationMs": 173.05599999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 229,
"frameDurationMs": 24.772972972972983,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "extension-clean-combined-draw",
"durationMs": 11065.547000000039,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10005.389000000001,
"heapDeltaBytes": 2317116,
"heapUsedBytes": 78708024,
"domNodes": -142,
"jsHeapTotalBytes": -7475200,
"scriptDurationMs": 8162.284,
"eventListeners": -74,
"totalBlockingTimeMs": 1159,
"frameDurationMs": 32.169186046511626,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "extension-clean-combined-draw",
"durationMs": 11219.044000000053,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10191.917,
"heapDeltaBytes": 15024840,
"heapUsedBytes": 99068844,
"domNodes": -142,
"jsHeapTotalBytes": -921600,
"scriptDurationMs": 8422.646,
"eventListeners": -78,
"totalBlockingTimeMs": 1464,
"frameDurationMs": 33.18402366863906,
"p95FrameDurationMs": 66.69999999999982
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 10633.999000000018,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9671.108,
"heapDeltaBytes": 5143884,
"heapUsedBytes": 81510748,
"domNodes": -142,
"jsHeapTotalBytes": -5378048,
"scriptDurationMs": 7897.044999999999,
"eventListeners": -78,
"totalBlockingTimeMs": 1007,
"frameDurationMs": 31.930330330330335,
"p95FrameDurationMs": 66.49999999999909
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 10422.055999999997,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.05400000000000196,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9506.949,
"heapDeltaBytes": 9545984,
"heapUsedBytes": 93695816,
"domNodes": -143,
"jsHeapTotalBytes": -5640192,
"scriptDurationMs": 7734.662,
"eventListeners": -82,
"totalBlockingTimeMs": 1083,
"frameDurationMs": 31.904892966360862,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "large-graph-idle",
"durationMs": 2021.7700000000605,
"styleRecalcs": 9,
"styleRecalcDurationMs": 4.263000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 631.538,
"heapDeltaBytes": -1971628,
"heapUsedBytes": 84104516,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 39.135000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2018.2839999999942,
"styleRecalcs": 9,
"styleRecalcDurationMs": 4.012000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 617.0379999999999,
"heapDeltaBytes": -850368,
"heapUsedBytes": 85127072,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 39.10199999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2793.4960000000046,
"styleRecalcs": 69,
"styleRecalcDurationMs": 11.464000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1725.89,
"heapDeltaBytes": -1418756,
"heapUsedBytes": 85189356,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 880.583,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.766867469879518,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2625.1909999999725,
"styleRecalcs": 67,
"styleRecalcDurationMs": 9.953,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1677.537,
"heapDeltaBytes": 24108696,
"heapUsedBytes": 86856212,
"domNodes": -328,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 833.861,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666242038216556,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3838.624999999979,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.374999999999998,
"layouts": 60,
"layoutDurationMs": 14.502,
"taskDurationMs": 1852.478,
"heapDeltaBytes": -10932068,
"heapUsedBytes": 78075088,
"domNodes": 0,
"jsHeapTotalBytes": 823296,
"scriptDurationMs": 872.993,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665652173913045,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3687.434000000053,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.136999999999995,
"layouts": 60,
"layoutDurationMs": 15.048000000000002,
"taskDurationMs": 1778.196,
"heapDeltaBytes": -11683832,
"heapUsedBytes": 76188532,
"domNodes": 0,
"jsHeapTotalBytes": 561152,
"scriptDurationMs": 815.2479999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666063348416294,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3189.4009999999753,
"styleRecalcs": 44,
"styleRecalcDurationMs": 7.436000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2054.093,
"heapDeltaBytes": -18341248,
"heapUsedBytes": 68914376,
"domNodes": 0,
"jsHeapTotalBytes": 1085440,
"scriptDurationMs": 1018.808,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.754497354497353,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3179.461999999944,
"styleRecalcs": 46,
"styleRecalcDurationMs": 7.588999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2022.9430000000002,
"heapDeltaBytes": 26628320,
"heapUsedBytes": 93783744,
"domNodes": 0,
"jsHeapTotalBytes": 1990656,
"scriptDurationMs": 1033.7350000000001,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.84232804232804,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2026.0710000000017,
"styleRecalcs": 9,
"styleRecalcDurationMs": 4.2909999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 589.555,
"heapDeltaBytes": -2027200,
"heapUsedBytes": 76493596,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 33.818,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2034.174000000121,
"styleRecalcs": 6,
"styleRecalcDurationMs": 2.426000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 620.0609999999998,
"heapDeltaBytes": -41001140,
"heapUsedBytes": 83691776,
"domNodes": -328,
"jsHeapTotalBytes": -3506176,
"scriptDurationMs": 33.217,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 644.5689999999331,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.520000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 435.388,
"heapDeltaBytes": 9323044,
"heapUsedBytes": 63106904,
"domNodes": -249,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 146.121,
"eventListeners": -200,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663157894736862,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 631.0949999999593,
"styleRecalcs": 48,
"styleRecalcDurationMs": 6.434,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 411.50800000000004,
"heapDeltaBytes": -11794220,
"heapUsedBytes": 57275168,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 147.45799999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664864864864875,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2009.582000000023,
"styleRecalcs": 8,
"styleRecalcDurationMs": 3.818,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 472.217,
"heapDeltaBytes": 777740,
"heapUsedBytes": 69317796,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 11.631999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2040.4059999999618,
"styleRecalcs": 10,
"styleRecalcDurationMs": 4.513000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 480.294,
"heapDeltaBytes": -27761424,
"heapUsedBytes": 75221812,
"domNodes": -250,
"jsHeapTotalBytes": -3145728,
"scriptDurationMs": 10.345,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1694.6970000000192,
"styleRecalcs": 60,
"styleRecalcDurationMs": 18.754,
"layouts": 16,
"layoutDurationMs": 6.971999999999999,
"taskDurationMs": 794.218,
"heapDeltaBytes": -6126388,
"heapUsedBytes": 62597280,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 121.171,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66568627450981,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1701.893000000041,
"styleRecalcs": 77,
"styleRecalcDurationMs": 19.599999999999998,
"layouts": 16,
"layoutDurationMs": 6.338,
"taskDurationMs": 814.0369999999999,
"heapDeltaBytes": -6092908,
"heapUsedBytes": 63346940,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 121.74300000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664705882352944,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1402.392999999961,
"styleRecalcs": 16,
"styleRecalcDurationMs": 30.59499999999999,
"layouts": 5,
"layoutDurationMs": 13.228999999999997,
"taskDurationMs": 985.158,
"heapDeltaBytes": 23952412,
"heapUsedBytes": 108299076,
"domNodes": 13747,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 29.56700000000001,
"eventListeners": 2383,
"totalBlockingTimeMs": 141,
"frameDurationMs": 19.952112676056345,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8890.556999999944,
"styleRecalcs": 247,
"styleRecalcDurationMs": 36.757999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6044.49,
"heapDeltaBytes": 25657084,
"heapUsedBytes": 88018512,
"domNodes": -328,
"jsHeapTotalBytes": 192512,
"scriptDurationMs": 2781.5640000000003,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.69736842105263,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8978.062999999907,
"styleRecalcs": 250,
"styleRecalcDurationMs": 35.092,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5972.678,
"heapDeltaBytes": -40367324,
"heapUsedBytes": 82666608,
"domNodes": -328,
"jsHeapTotalBytes": -2002944,
"scriptDurationMs": 2723.417,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.697206703910613,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17487.892999999985,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16683.751999999997,
"heapDeltaBytes": -34778708,
"heapUsedBytes": 190428132,
"domNodes": -3045,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 273.235,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.681663837011886,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "vue-large-graph-idle",
"durationMs": 17398.02499999996,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16703.995999999996,
"heapDeltaBytes": -33922668,
"heapUsedBytes": 174929836,
"domNodes": -3045,
"jsHeapTotalBytes": 12603392,
"scriptDurationMs": 288.33400000000006,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.24268907563025,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "vue-large-graph-pan",
"durationMs": 21306.953000000023,
"styleRecalcs": 167,
"styleRecalcDurationMs": 19.88899999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20891.200999999997,
"heapDeltaBytes": -45098928,
"heapUsedBytes": 179968404,
"domNodes": -3045,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 896.2170000000001,
"eventListeners": -14915,
"totalBlockingTimeMs": 52,
"frameDurationMs": 38.96855575868373,
"p95FrameDurationMs": 83.30000000000109
},
{
"name": "vue-large-graph-pan",
"durationMs": 21328.719000000092,
"styleRecalcs": 173,
"styleRecalcDurationMs": 20.01,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20910.549000000003,
"heapDeltaBytes": -34915520,
"heapUsedBytes": 168692376,
"domNodes": -3045,
"jsHeapTotalBytes": 7680000,
"scriptDurationMs": 923.4309999999999,
"eventListeners": -14915,
"totalBlockingTimeMs": 57,
"frameDurationMs": 39.358671586715865,
"p95FrameDurationMs": 83.29999999999927
},
{
"name": "vue-node-resize-workload",
"durationMs": 6292.912999999999,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.376,
"layouts": 20,
"layoutDurationMs": 26.581000000000007,
"taskDurationMs": 6176.594,
"heapDeltaBytes": -5617836,
"heapUsedBytes": 202768992,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 117.362,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 36.743274853801175,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 6301.513000000114,
"styleRecalcs": 20,
"styleRecalcDurationMs": 82.18300000000004,
"layouts": 20,
"layoutDurationMs": 25.723999999999997,
"taskDurationMs": 6193.716000000001,
"heapDeltaBytes": 795860,
"heapUsedBytes": 202404076,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 109.096,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 37.05705882352942,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8863.284000000021,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8504.351999999999,
"heapDeltaBytes": -44645372,
"heapUsedBytes": 169100108,
"domNodes": -3045,
"jsHeapTotalBytes": 7073792,
"scriptDurationMs": 138.63800000000003,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.515862068965525,
"p95FrameDurationMs": 66.69999999999709
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8751.336999999921,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8463.104000000001,
"heapDeltaBytes": -41626248,
"heapUsedBytes": 184030420,
"domNodes": -3045,
"jsHeapTotalBytes": 8126464,
"scriptDurationMs": 134.01700000000005,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.559459459459454,
"p95FrameDurationMs": 66.59999999999854
},
{
"name": "workflow-execution",
"durationMs": 146.4090000000624,
"styleRecalcs": 11,
"styleRecalcDurationMs": 16.839,
"layouts": 4,
"layoutDurationMs": 2.1159999999999997,
"taskDurationMs": 108.101,
"heapDeltaBytes": 4030060,
"heapUsedBytes": 68526728,
"domNodes": 99,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 13.079000000000008,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 19.04285714285717,
"p95FrameDurationMs": 33.30000000000018
},
{
"name": "workflow-execution",
"durationMs": 473.01599999991595,
"styleRecalcs": 12,
"styleRecalcDurationMs": 14.388000000000002,
"layouts": 3,
"layoutDurationMs": 0.97,
"taskDurationMs": 124.751,
"heapDeltaBytes": 5721608,
"heapUsedBytes": 59146128,
"domNodes": -131,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.447999999999999,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379316,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 912.954000000127,
"styleRecalcs": 78,
"styleRecalcDurationMs": 104.631,
"layouts": 76,
"layoutDurationMs": 25.3,
"taskDurationMs": 882.7189999999999,
"heapDeltaBytes": 18024956,
"heapUsedBytes": 88899168,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 366.03400000000005,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667272727272742,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 1011.169000000109,
"styleRecalcs": 78,
"styleRecalcDurationMs": 108.304,
"layouts": 76,
"layoutDurationMs": 27.907,
"taskDurationMs": 973.1600000000001,
"heapDeltaBytes": 18890048,
"heapUsedBytes": 89938132,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 394.89300000000003,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.94500000000001,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1447.5669999999354,
"styleRecalcs": 78,
"styleRecalcDurationMs": 265.53,
"layouts": 76,
"layoutDurationMs": 29.18,
"taskDurationMs": 1429.071,
"heapDeltaBytes": 8413284,
"heapUsedBytes": 113642656,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 487.683,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.35316455696202,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1383.6429999998927,
"styleRecalcs": 78,
"styleRecalcDurationMs": 255.58199999999997,
"layouts": 76,
"layoutDurationMs": 28.171000000000003,
"taskDurationMs": 1361.027,
"heapDeltaBytes": -19270948,
"heapUsedBytes": 109024948,
"domNodes": 76,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 449.986,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.735897435897453,
"p95FrameDurationMs": 33.30000000000109
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
… and failed stages (#19945) ## Summary Billing web reports its cancel flow as billing.cancel.intent, billing.cancel.abandoned and billing.cancel.failed, using the cancel contract from FE-3115. ## Why E14 needs the cancel flow on both hosts. The cloud app gets it in FE-3115. Billing web reported nothing for its cancel flow: a customer who opened the confirmation and kept the plan, and a cancel the server refused before any operation existed, were invisible. A refusal before an operation exists is also invisible to the SDK stream, because the SDK only reports operations. ## How createCancelFlowTelemetry in apps/billing-web/src/telemetry/cancelTelemetry.ts reports intent when the confirmation opens, abandoned when the customer picks Keep my plan or the surface unmounts with the confirmation still open, and failed only when the cancel command returns a refusal (status error), classified through the shared outcomeOfCommandResult. Once the customer confirms, the flow is no longer abandoned, and a cancel that issued an operation ends in the SDK's billing.operation.* events with operation_type cancel, so this flow adds no terminal of its own. Each event carries billing_client sdk and the current plan's tier and cycle, which SubscriptionPanel passes down from the plan catalog. checkoutTierOf is exported from subscriptionCheckoutTelemetry.ts so both flows map server tiers the same way. There is no user-visible change. ## Review Focus - Ownership: failed fires only for status error; an ok result with or without an operation reports nothing here. - Abandoned on unmount covers leaving the surface in the app; closing the tab with the confirmation open is not reported. - A thrown cancel command (not a returned refusal) reports nothing, matching the cloud rule that a confirmed flow's end belongs to the operation. - Merge note: origin/main's #19811 adds the resubscribe telemetry import on the same lines of SubscriptionActions.vue. Merging main into this branch (or into FE-3115) gives a two-line import conflict; keep both imports. ## 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 opening the confirmation and keeping the plan | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly)<br>`billing.cancel.abandoned` (billing_client: sdk, current_tier: pro, cycle: yearly) | | reports leaving the page while the confirmation is open as abandoned | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly)<br>`billing.cancel.abandoned` (billing_client: sdk, current_tier: pro, cycle: yearly) | | leaves the end of a cancel the server settled to the operation events | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly) | | leaves the end of a cancel operation that failed to the operation events | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly) | | leaves the end of a cancel that already held to the operation events | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly) | | reports a request that never reached the server as a failed cancel before any operation exists | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly)<br>`billing.cancel.failed` (billing_client: sdk, current_tier: pro, cycle: yearly, failure_category: network) | | reports no subscription to cancel as a failed cancel before any operation exists | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly)<br>`billing.cancel.failed` (billing_client: sdk, current_tier: pro, cycle: yearly, failure_category: api_rejected) | | reports an earlier payment still open as a failed cancel before any operation exists | billing_web | nothing | `billing.cancel.intent` (billing_client: sdk, current_tier: pro, cycle: yearly)<br>`billing.cancel.failed` (billing_client: sdk, current_tier: pro, cycle: yearly, failure_category: api_rejected, error_code: operation_already_pending) | Captured RUM actions and PostHog events for eight cancel paths on billing web show nothing on the FE-3115 base and intent, abandoned or failed with tier, cycle and failure category on this branch (evidence-fe3117-web-cancel/). ## Where this sits in the plan Linear: [FE-3117](https://linear.app/comfyorg/issue/FE-3117), part of [FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards). Plan, event catalog and dependency graph: [action items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89). | Task | Ticket | What | Status | | --- | --- | --- | --- | | T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT | | T2 | FE-3108 | Decide RUM application and env mapping | decided | | T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR 19688](#19688), merged | | T3+ | FE-3156 | Opaque RUM user id on billing web | [PR 19794](#19794), merged | | T4, F1 | FE-3106 | SDK-rail ownership | [PR 19620](#19620), merged | | T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR 19623](#19623), merged | | T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR 19685](#19685), merged | | T4, F5 | FE-3112 | SDK top-up terminals | [PR 19628](#19628), merged | | T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR 19622](#19622), merged | | T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR 19627](#19627), merged | | T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices | [PR 19686](#19686), merged | | T4+ | FE-3140 | Move the billing event contract to a shared package | [PR 19798](#19798), 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 | this PR | | T8 | FE-3118 | Billing web journey and choices | [PR 19819](#19819) (three parts), merged | | T9 | FE-3119 | Payment friction events | todo | | 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 | todo | | 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 T7 stroke-width:3px ``` --------- Co-authored-by: GitHub Action <action@github.com>
…he cloud app and billing web (#19944) ## 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)<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) | 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](https://linear.app/comfyorg/issue/FE-3121), 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 | | T8 | FE-3118 | Billing web journey and choices | [PR 19819](#19819) (three parts), merged | | T9 | FE-3119 | Payment friction events | todo | | 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 | this PR | | 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 T11 stroke-width:3px ```
…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 ```
…g#19811) ## Summary Billing web reports the resubscribe lifecycle from the subscription screen: `billing.resubscribe.started` before the request and one `billing.resubscribe.succeeded` or `.failed`, with `source: 'billing_web_subscription'`. This is the third of three stacked branches for FE-3117 and delivers E13. It reuses the attempt tracker from the branch that delivers E10 and E11. ## Why The SDK reports a resubscribe as a plain `subscription` operation, so the operation stream cannot tell a resubscribe from a new subscription or a plan change. The cloud app reports `billing.resubscribe.*` from its callers. Billing web reported nothing, so a resubscribe, a plan that was already active and a refusal before any operation were all invisible. ## Root cause The resubscribe button on billing web called `checkout.resubscribe()` with no emitter, and the `resubscribe` event type had no operation id, no duration and no billing web source. ## How - **Events.** `resubscribeTelemetry.ts` builds the events on the same `createAttemptTelemetry` and result mapping as the checkout. The start is reported immediately before `checkout.resubscribe()`. The terminal carries `billing_op_id` once one exists, `duration_ms`, and for a decline its `decline_reason`. A plan that was already active (the SDK's already-held answer, which issues nothing) counts as succeeded and has no operation id. `payment_intent_source` is the entry source when the customer arrived with one. - **Wiring.** `SubscriptionActions.vue` wraps its one `checkout.resubscribe()` call. Cancel is unchanged. - **Contract.** `ResubscribeBillingEvent` gains `billing_op_id`, `duration_ms` and `decline_reason` on its failed variant, all optional, so the cloud's events are unchanged. `ResubscribeSource` gains `billing_web_subscription`. - **README.** A short paragraph in the Telemetry section. ## Review Focus - FE-3140 (Comfy-Org#19798) is merged into main (`a8337f39a4`), and with it FE-3120's three parts (Comfy-Org#19804, Comfy-Org#19806, Comfy-Org#19807) and FE-3117's parts 1 and 2 (Comfy-Org#19809, Comfy-Org#19810). The base of this PR is main. Review only part 3's own change (E13, the resubscribe lifecycle, 9 files against main). This branch also carries one automated formatting commit. - The new `source` value is `billing_web_subscription`. The catalog says only "billing web value". The cloud names its two values after its own screens (`pricing_dialog`, `settings_billing_panel`), so I named this one after billing web's subscription screen. It is a one-line change in `vocabulary.ts` if you prefer another name. - `billing_client: 'sdk'` is stamped, as on the checkout events, because billing web has no legacy path. - A resubscribe that needs a hosted payment step redirects this tab, so the page unloads and no terminal is sent. That start is the abandoned case of FE-3119. A recovered operation after the return reports only the SDK stream, never `billing.resubscribe.*`, as the SSOT requires. - There is no continuation state for resubscribe: the SDK never asks for the reactivation consent on this command. - The SDK stream still reports the same resubscribe as `billing.operation.*` with `operation_type: 'subscription'`. Join the two by `billing_op_id`. They are two signals of one attempt, not two attempts. - E14 (billing web cancel intent, abandoned and failed) is not built. FE-3115 defines the cancel event contract first, so E14 follows it. Billing web's cancel today reports only the SDK stream. A test pins that a cancel emits no `billing.resubscribe.*` event. - Known gap: billing web rebuilds its return links without `source`, so a resubscribe that returns from a provider page cannot carry the entry source. It reports no business event there anyway. - No user-visible change. Billing web sends new RUM actions and PostHog events and nothing else changes. - `UnifiedPricingTable.test.ts` ("prompts free-tier users to subscribe") fails locally on `origin/main` too under Node 24. This diff does not touch it. ## AS IS / TO BE AS IS:  TO BE:  The evidence is the RUM actions billing web sends when a customer resubscribes from the subscription screen and the request settles, is a plan that was already active, is declined, or is refused before an operation exists: before, none; after, `billing.resubscribe.started` and one terminal with `billing_client: 'sdk'` and the billing web source. ## Where this sits in the plan Linear: [FE-3117](https://linear.app/comfyorg/issue/FE-3117), part of [FE-3105](https://linear.app/comfyorg/issue/FE-3105/billing-web-and-sdk-rollout-telemetry-events-fixes-and-dashboards). Plan, event catalog and dependency graph: [action items](https://app.notion.com/p/3ea6d73d3650814ba248d4d1431b8a89). | Task | Ticket | What | Status | | --- | --- | --- | --- | | T1 | FE-3107 | Decide vocabulary and dimensions | done, in the SSOT | | T2 | FE-3108 | Decide RUM application and env mapping | decided | | T3 | FE-3109 | Billing web telemetry bootstrap (RUM and PostHog) | [PR 19688](Comfy-Org#19688), merged | | T3+ | FE-3156 | Opaque RUM user id on billing web | [PR 19794](Comfy-Org#19794), merged | | T4, F1 | FE-3106 | SDK-rail ownership | [PR 19620](Comfy-Org#19620), merged | | T4, F2 | FE-3110 | Keep operation id and fields in the mapper | [PR 19623](Comfy-Org#19623), merged | | T4, F3 | FE-3111 | Stamp billing_surface and billing_client | [PR 19685](Comfy-Org#19685), merged | | T4, F5 | FE-3112 | SDK top-up terminals | [PR 19628](Comfy-Org#19628), merged | | T4, F6 | FE-3113 | Downgrade reconciliation terminal | [PR 19622](Comfy-Org#19622), merged | | T4, F7 | FE-3114 | Legacy personal-rail events, first slice | [PR 19627](Comfy-Org#19627), merged | | T4, F7+ | FE-3131 | Legacy personal-rail events, remaining slices | [PR 19686](Comfy-Org#19686), merged | | T4+ | FE-3140 | Move the billing event contract to a shared package | [PR 19798](Comfy-Org#19798), merged | | T5 | FE-3115 | Cloud entry fidelity and Datadog parity | [PR 19815](Comfy-Org#19815), [PR 19816](Comfy-Org#19816), [PR 19817](Comfy-Org#19817), [PR 19818](Comfy-Org#19818), in review | | T6 | FE-3116 | Handoff contract and event | [PR 19687](Comfy-Org#19687), merged | | T7 | FE-3117 | Billing web attempt lifecycle | this PR | | T8 | FE-3118 | Billing web journey and choices | [PR 19819](Comfy-Org#19819), [PR 19821](Comfy-Org#19821), [PR 19822](Comfy-Org#19822), in review | | T9 | FE-3119 | Payment friction events | todo | | T10 | FE-3120 | Billing web entry, session and return | [PR 19804](Comfy-Org#19804), [PR 19806](Comfy-Org#19806) and [PR 19807](Comfy-Org#19807), merged in [PR 19798](Comfy-Org#19798) | | T11 | FE-3121 | Portal events | todo | | T12 | FE-3122 | Flag coverage check | todo | | T13 | FE-3123 | PostHog rollout dashboard | todo | | T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo | | T15 | FE-3125 | Verification per flow | todo | | T16 | FE-3126 | Rollout plan | todo | ```mermaid flowchart LR subgraph DEC["Decided"] T1["FE-3107 T1 vocabulary"] T2["FE-3108 T2 RUM app and env"] end subgraph FIX["Existing events (T4)"] F1["FE-3106 F1 SDK-rail ownership"] F2["FE-3110 F2 mapper fields"] F3["FE-3111 F3 surface and client"] F5["FE-3112 F5 top-up terminals"] F6["FE-3113 F6 downgrade terminal"] F7["FE-3114 F7 legacy personal, first slice"] F7B["FE-3131 F7 remaining slices"] C140["FE-3140 event contract to shared package"] end subgraph EMIT["New events"] T3["FE-3109 T3 billing web bootstrap"] T3b["FE-3156 T3+ opaque RUM user id"] T5["FE-3115 T5 cloud entry and parity"] T6["FE-3116 T6 handoff contract"] T7["FE-3117 T7 attempt lifecycle"] T8["FE-3118 T8 journey and choices"] T9["FE-3119 T9 friction"] T10["FE-3120 T10 entry, session, return"] T11["FE-3121 T11 portal"] T12["FE-3122 T12 flag coverage"] end subgraph DASH["Dashboards"] T13["FE-3123 T13 PostHog rollout"] T14["FE-3124 T14 Frontend RUM tiles"] end T15["FE-3125 T15 verification"] T16["FE-3126 T16 rollout plan"] T2 --> T3 T3 --> T3b F3 --> C140 T3 --> C140 C140 --> T7 C140 --> T8 C140 --> T10 C140 --> T11 T1 --> F3 T1 --> T5 T1 --> T6 T1 --> T13 T1 --> T14 T2 --> T14 F2 --> T7 T3 --> T7 T3 --> T8 T3 --> T10 T3 --> T11 T3 --> T12 T5 --> T11 T6 --> T8 T6 --> T10 T7 --> T9 T8 --> T9 F1 --> T13 F3 --> T13 FIX --> T15 T5 --> T15 T9 --> T15 T10 --> T15 T11 --> T15 T12 --> T15 T13 --> T15 T14 --> T15 T13 --> T16 T15 --> T16 style T7 stroke-width:3px ``` --------- Co-authored-by: GitHub Action <action@github.com>
… events (Comfy-Org#19943) ## Summary Cloud app checkout journey events (billing.checkout.*) now carry billing_surface: 'cloud_app' in Datadog RUM and PostHog. ## Why Decision T1 says every billing event carries billing_surface. On the cloud app the billing.<operation>.<stage> events already did, but the checkout journey events did not. Billing web stamps billing_web on the same journey events, so the Datadog tiles (FE-3124) that group by @context.billing_surface showed cloud journey traffic with no surface. ## Root cause getCheckoutJourneyTelemetryEventPayload builds the journey payload with no surface. The cloud Datadog RUM and PostHog providers sent it as is. Billing web adds the surface itself inside trackCheckoutJourneyEvent, so only billing web output had it. ## How A new getCloudAppCheckoutJourneyTelemetryEventPayload in packages/account-core/src/core/billing/telemetry/checkoutJourney.ts wraps the existing builder and adds billing_surface: 'cloud_app'. It mirrors getCloudAppBillingTelemetryEventPayload. Both cloud sinks that receive journey events (DatadogRumTelemetryProvider and PostHogTelemetryProvider) call it in trackCheckoutJourneyEvent. The shared builder and billing web are untouched. ## Review Focus - Only one field is added. Event names and every existing field value are unchanged (see the AS IS vs TO BE diff in the evidence). - Billing web output does not change. It still stamps billing_web itself on top of the unstamped shared builder. - Datadog RUM and PostHog are the only providers that implement trackCheckoutJourneyEvent, so no other sink needs the stamp. ## AS IS / TO BE Telemetry payload change, so the evidence is the captured event rather than a screenshot. One `billing.checkout.entered` sent through the real cloud Datadog RUM and PostHog providers, origin/main (AS IS) vs this branch (TO BE): ```diff 23c23,24 < "payment_intent_source": "subscribe_to_run" --- > "payment_intent_source": "subscribe_to_run", > "billing_surface": "cloud_app" 37c38,39 < "payment_intent_source": "subscribe_to_run" --- > "payment_intent_source": "subscribe_to_run", > "billing_surface": "cloud_app" ``` Captured payloads for one billing.checkout.entered event through the real cloud Datadog RUM and PostHog providers show billing_surface missing on origin/main and billing_surface: 'cloud_app' on the branch, with all other fields identical (evidence-fe3111-journey-surface/). ## Where this sits in the plan Linear: [FE-3111](https://linear.app/comfyorg/issue/FE-3111), 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 | this PR | | 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 | | 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 | todo | | T12 | FE-3122 | Flag coverage check | todo | | T13 | FE-3123 | PostHog rollout dashboard | todo | | T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | [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 F3 stroke-width:3px ```
Comfy-Org#19941) ## Summary Billing web: Retry session after the shared session fails to create now retries the creation. A remembered login whose restore keeps failing no longer leaves the sign-in screen unsettled. ## Why In shared-web-session mode a 503 on POST /auth/session left the customer on a Retry session button that could never succeed. With a remembered Firebase user and a failing restore, the sign-in screen showed 'Sign-in is unavailable' with every button disabled, so the customer had no way forward until the endpoint recovered. ## Root cause Two gaps in unifiedBillingSession.ts. First, establish() with no user only re-resolved the workspace. That answers NOT_AUTHENTICATED without a request when the shared session does not exist. The controller's retry always calls establish() with no user, so the failed creation was never retried. Second, settledOf() treated the identity's retry_wait phase as not settled. A restore that keeps failing loops through retry_wait, reading and restoring, so settledPhase() never resolved, loadIdentity() never loaded Firebase, and the sign-in page showed the unavailable notice. ## How establish() now picks who to create the session for: the passed user, or, when there is no signed-in shared session, the user Firebase currently holds. With such a user it re-mints the ID token and POSTs the session again, then reboots the identity as the interactive path already did. With no Firebase user it still answers NOT_AUTHENTICATED without a request, and the sign-in form stays the way forward. settledOf() maps retry_wait to signed-out, so the sign-in screen settles and renders the form while the identity keeps retrying in the background. A later successful restore still carries the customer off the page. ## Review Focus - retry_wait now reads as signed-out. The router sends such a visit to sign-in, and the once-per-tab signin_required event reports reason no_session for it. A transient GET /auth/session failure on a live session also shows the form until the next retry succeeds (1s, then backoff). - establish() with no user now loads Firebase when the shared session is not signed in. When it is signed in (a restored session, or a retry after a workspace refusal) the behavior is unchanged. - After the fix, billing.web_session.failed with error_code NOT_AUTHENTICATED stops appearing for the retry path. A failed retry reports TOKEN_EXCHANGE_FAILED instead. - In the remembered-login case the screen shows the sign-in form, not a Retry session button. Signing in again or waiting for the background retry both recover. ## AS IS / TO BE **A. Interactive sign-in, POST /auth/session 503, then Retry session** | AS IS | TO BE | | --- | --- | | <img width="420" alt="AS IS: Retry session after 503" src="https://github.com/user-attachments/assets/b7acf55a-fcd5-4610-a6f9-64c75d6d9606" /> | <img width="420" alt="TO BE: Retry session after 503" src="https://github.com/user-attachments/assets/9f8831d3-1cf1-474a-bae3-cdbfbbfaa007" /> | | Retry session sends no request; the same error stays. | Retry session re-mints the token, POST answers 200, the page leaves sign-in. | Both builds start from the same screen after the 503: [A1](https://github.com/user-attachments/assets/f163f436-92c7-4cda-9d22-a1371dff9e89). **B. Remembered user, session restore keeps answering 503** | AS IS | TO BE | | --- | --- | | <img width="420" alt="AS IS: remembered user with failing restore" src="https://github.com/user-attachments/assets/7379aa7c-bc2e-45bd-b34c-aa114a0ca7da" /> | <img width="420" alt="TO BE: remembered user with failing restore" src="https://github.com/user-attachments/assets/05b8bc35-1793-4f68-b9cf-2d192cce36ca" /> | | 'Sign-in is unavailable' with every button disabled; the phase never settles. | The sign-in form renders and works; the restore keeps retrying in the background. | Once the endpoint answers 200, both builds restore the session and leave sign-in. **C. Control (no outage)** | AS IS | TO BE | | --- | --- | | <img width="420" alt="AS IS: control" src="https://github.com/user-attachments/assets/9f8831d3-1cf1-474a-bae3-cdbfbbfaa007" /> | <img width="420" alt="TO BE: control" src="https://github.com/user-attachments/assets/9f8831d3-1cf1-474a-bae3-cdbfbbfaa007" /> | | Sign-in succeeds and leaves sign-in. | Identical. | Playwright against a local production build with the session endpoint stubbed to 503 then 200 shows AS IS stuck on Retry session and on a disabled sign-in screen, and TO BE recovering in both paths (evidence-fe3158/). ## Where this sits in the plan Linear: [FE-3158](https://linear.app/comfyorg/issue/FE-3158), 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 | | 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 | todo | | T12 | FE-3122 | Flag coverage check | todo | | T13 | FE-3123 | PostHog rollout dashboard | todo | | T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | [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 | this PR | | 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 ```
…count-core (Comfy-Org#19940) ## Summary Move the three billing payload-helper test suites from src/platform/telemetry into packages/account-core/src/core/billing/telemetry, next to the code they test. There is no user-visible change and no source change. ## Why FE-3140 moved the billing event contract and payload helpers into @comfyorg/account-core/billing. Three suites stayed in the app folder. They tested no code in that folder, imported the package through its public entry, and partly repeated cases the package already had. ## How billingTelemetryEvent.test.ts (app) splits in two. The late-success type test becomes account-core billingTelemetryEvent.test.ts. The getBillingTelemetryEventPayload cases join payload.test.ts. checkoutJourneyEvent.test.ts joins checkoutJourney.test.ts. webHandoffEvent.test.ts moves as is. Imports are now package-relative. es-toolkit pick, which account-core does not depend on, becomes an own-key filter with the same semantics (an absent key stays absent, so toStrictEqual still tells absent from undefined). Two cases are dropped because existing account-core cases already prove them: the cloud-app surface claim (identical to the cloud app row of the SURFACES table in payload.test.ts) and 'omits assigned_arm when assignment is unavailable' (every unavailable row in checkoutJourney.test.ts asserts the whole payload with toStrictEqual). Every other assertion moved unchanged. ## Review Focus - The two dropped cases really are covered by payload.test.ts SURFACES[cloud app] and the checkoutJourney.test.ts strict payload table. - The Object.entries filter that replaces es-toolkit pick keeps the absent versus undefined distinction. - The late-success expectTypeOf test is still type-checked: account-core tsconfig includes src/**/*, and typecheck:account-core passed in the pre-commit hook. ## AS IS / TO BE Test-only change, so the evidence is the test run instead of a screenshot. | Suite | AS IS | TO BE | | --- | --- | --- | | src/platform/telemetry billing helper suites (3 files) | 37 | 0 (moved) | | account-core billing/telemetry | 30 | 65 | | Total helper tests | 67 | 65 (2 exact duplicates dropped) | | Remaining src/platform/telemetry | 567 | 567, all pass | Before, 37 helper tests ran in the app suite and 30 in account-core (67). After, account-core runs 65 and all pass, the remaining src/platform/telemetry suite runs 567 and all pass, and the only difference is the 2 duplicate cases named in how. ## Where this sits in the plan Linear: [FE-3162](https://linear.app/comfyorg/issue/FE-3162), 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 | | 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 | todo | | T12 | FE-3122 | Flag coverage check | todo | | T13 | FE-3123 | PostHog rollout dashboard | todo | | T14 | FE-3124 | Datadog tiles in the Frontend RUM dashboard | todo | | T4+ | FE-3162 | Move the payload-helper tests to account-core | this PR | | T10+ | FE-3158 | Billing web Try again after session creation fails | todo | | T15 | FE-3125 | Verification per flow | todo | | T16 | FE-3126 | Rollout plan | todo | ```mermaid flowchart LR subgraph DEC["Decided"] T1["FE-3107 T1 vocabulary"] T2["FE-3108 T2 RUM app and env"] end subgraph FIX["Existing events (T4)"] F1["FE-3106 F1 SDK-rail ownership"] F2["FE-3110 F2 mapper fields"] F3["FE-3111 F3 surface and client"] F5["FE-3112 F5 top-up terminals"] F6["FE-3113 F6 downgrade terminal"] F7["FE-3114 F7 legacy personal, first slice"] F7B["FE-3131 F7 remaining slices"] C140["FE-3140 event contract to shared package"] end subgraph EMIT["New events"] T3["FE-3109 T3 billing web bootstrap"] T3b["FE-3156 T3+ opaque RUM user id"] T5["FE-3115 T5 cloud entry and parity"] T6["FE-3116 T6 handoff contract"] T7["FE-3117 T7 attempt lifecycle"] T8["FE-3118 T8 journey and choices"] T9["FE-3119 T9 friction"] T10["FE-3120 T10 entry, session, return"] T11["FE-3121 T11 portal"] T12["FE-3122 T12 flag coverage"] end subgraph DASH["Dashboards"] T13["FE-3123 T13 PostHog rollout"] T14["FE-3124 T14 Frontend RUM tiles"] end T15["FE-3125 T15 verification"] T16["FE-3126 T16 rollout plan"] T2 --> T3 T3 --> T3b F3 --> C140 T3 --> C140 C140 --> T7 C140 --> T8 C140 --> T10 C140 --> T11 T1 --> F3 T1 --> T5 T1 --> T6 T1 --> T13 T1 --> T14 T2 --> T14 F2 --> T7 T3 --> T7 T3 --> T8 T3 --> T10 T3 --> T11 T3 --> T12 T5 --> T11 T6 --> T8 T6 --> T10 T7 --> T9 T8 --> T9 F1 --> T13 F3 --> T13 FIX --> T15 T5 --> T15 T9 --> T15 T10 --> T15 T11 --> T15 T12 --> T15 T13 --> T15 T14 --> T15 T13 --> T16 T15 --> T16 ```
…ads feature flags (Comfy-Org#19942) ## Summary Billing web sends its billing events to PostHog only after PostHog has loaded the feature flags, so every event carries the rollout flags the cohort tiles split on. ## Why The rollout dashboard splits billing events by $feature/<flag>. PostHog adds those properties only from the flags it has already loaded on that origin. Billing web flushed the events it queued at boot right after init, before the flags request answered, and a first visit to billing.comfy.org has no cached flags. Its entry, session and first journey events would reach PostHog without any flag, so the cohort split and the second sign-in tile by unified_web_session would miss them. ## Root cause startPostHog marked the sink ready and flushed the waiting queue as soon as posthog.init returned. Flags load asynchronously after init and are stored per origin, so the flushed events had no $feature/* properties. ## How startPostHog now waits for PostHog's first onFeatureFlags callback before it marks the sink ready and flushes. The wait is bounded at 3 seconds, so a slow or blocked flags request delays events but never drops them. Events tracked during the wait stay in the existing bounded queue. The README notes the wait. There is no user-visible change. ## Review Focus - The 3 second bound: long enough for the flags request, short enough that a tab closed early still sends. - Events tracked while waiting use the existing queue of at most 50 events. - The test fake makes onFeatureFlags call back at once by default, as posthog-js does when flags are already loaded. ## AS IS / TO BE AS IS: placeholder, to be attached by editing this description. TO BE: placeholder, to be attached by editing this description. PostHog has no billing web events yet because the deployed billing web builds predate the PostHog sink, so the evidence is the red then green unit test plus the cloud coverage queries in t12-flag-coverage.md; AS IS / TO BE payload capture needs a billing web deploy from this branch. ## Where this sits in the plan Linear: [FE-3122](https://linear.app/comfyorg/issue/FE-3122), 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 | | 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 | todo | | T12 | FE-3122 | Flag coverage check | this PR | | T13 | FE-3123 | PostHog rollout dashboard | todo | | 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 T12 stroke-width:3px ```
…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 ```
…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:  TO BE:  **Part 2, source fidelity** AS IS:  TO BE:  **Part 3, top-up amount and preset** AS IS:  TO BE:  **Part 4, cancel flow** AS IS:  TO BE:  **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>
… 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 ```
…ilures and returns (Comfy-Org#19973) ## Summary The payment recovery portal that checkout opens after a failed or outstanding payment now reports billing.portal.opened, billing.portal.failed and billing.portal.returned with the new target payment_recovery. ## Why FE-3121 instrumented Manage subscription, Invoice history and the billing web portal, but left out the portal that useSubscriptionCheckout opens when a plan change is refused for an unpaid invoice. That trip is the only way a customer in payment_failed or paused can get unstuck, and it reached error reporting only on failure and nothing at all on success. The Datadog Billing UI tab and the PostHog rollout dashboard could not count it. ## How recoverOutstandingPayment now uses createBillingPortalReporter, the same reporter as the other cloud portal entries. readPaymentPortalUrl returns which client served the URL, so opened, failed and returned carry billing_client sdk or legacy once that is known. A thrown request failure omits billing_client, as the workspace Manage subscription path does. A blocked tab is failed with redirect and payment_popup_blocked. When the toast's Try again then opens the tab, that click is the open and waits for one return. A URL that fails the origin check is failed with unknown. The contract gains one bounded value, payment_recovery, in BillingPortalTarget. None of the existing values fits: payment_methods is the voluntary card management panel on billing web, and folding recovery into it would hide how often checkout blocks on an unpaid invoice. target is already allowlisted as a required payload field, so the allowlist needs no new key. There is no user-visible change. Toasts, the Try again action, the return refresh and the reportError calls are unchanged. ## Review Focus - billing_client is set only after the URL came back. A rail error or a refused workspace request omits it, matching useWorkspaceBilling; a URL rejected by the origin check keeps it. - The toast's Try again now checks the window.open result to report opened or blocked. It still arms the return refresh either way, as before. - A stale attempt (isCurrent false) reports nothing, the same way it shows nothing. - payment_recovery is a new BillingPortalTarget value. Dashboards that list portal targets need the fourth value (T13 PostHog, T14 Datadog tiles). - Comfy-Org#19921 is untouched: the WORKSPACE_BILLING_REQUIRED rethrow lives in useSubscription, not in this path. ## 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 the recovery portal opening from the legacy client and one return | cloud_app | nothing | `billing.portal.opened` (target: payment_recovery, billing_client: legacy)<br>`billing.portal.returned` (target: payment_recovery, billing_client: legacy) | | reports the recovery portal opening from the SDK rail and one return | cloud_app | nothing | `billing.portal.opened` (target: payment_recovery, billing_client: sdk)<br>`billing.portal.returned` (target: payment_recovery, billing_client: sdk) | | reports the recovery portal opening from the legacy client when the rail route i… and one return | cloud_app | nothing | `billing.portal.opened` (target: payment_recovery, billing_client: legacy)<br>`billing.portal.returned` (target: payment_recovery, billing_client: legacy) | | reports a blocked recovery tab as a failed open and the retry as the open | cloud_app | nothing | `billing.portal.failed` (target: payment_recovery, billing_client: legacy, failure_category: redirect, error_code: payment_popup_blocked)<br>`billing.portal.opened` (target: payment_recovery, billing_client: legacy)<br>`billing.portal.returned` (target: payment_recovery, billing_client: legacy) | | reports a refused legacy portal request as a failed open and keeps the error report | cloud_app | nothing | `billing.portal.failed` (target: payment_recovery, failure_category: api_rejected) | | reports a legacy portal request that never reac… as a failed open and keeps the error report | cloud_app | nothing | `billing.portal.failed` (target: payment_recovery, failure_category: network) | | reports a rail portal failure as a failed open and keeps the error report | cloud_app | nothing | `billing.portal.failed` (target: payment_recovery, failure_category: api_rejected) | | reports a portal address that fails validation as a failed open and keeps the error report | cloud_app | nothing | `billing.portal.failed` (target: payment_recovery, billing_client: legacy, failure_category: unknown) | | reports nothing when the rejection needs no payment recovery | cloud_app | nothing | nothing | Captured RUM actions and PostHog events for each recovery path show nothing on the FE-3115 base and the matching billing.portal.* event with target payment_recovery, client and failure category on this branch, with identical reportError calls (evidence-fe3121-recovery/). ## Where this sits in the plan Linear: [FE-3121](https://linear.app/comfyorg/issue/FE-3121), 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 | [PR 19946](Comfy-Org#19946), [PR 19947](Comfy-Org#19947), [PR 19948](Comfy-Org#19948), in review | | 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 | this PR | | 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 T11 stroke-width:3px ``` --------- Co-authored-by: GitHub Action <action@github.com>
…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 ```
…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 ```
…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 ```
Summary
Part 1 of 3. Both billing web checkouts report the first two steps of the checkout journey in the cloud app's phases:
billing.checkout.entered, thenpreview_readyorpreview_failed. Every event carriesbilling_surface: 'billing_web'and aui_modeofembeddedorfull_page.Why
Billing web sends no checkout funnel today. The cloud app and billing web cannot be compared per surface, and the rollout cannot see how many customers open the billing web checkout or how many get a quote. This part adds the same entry and quote steps on both billing web checkouts, including the quotes and capability reads that refuse a customer.
Root cause
The
billing.checkout.<phase>journey exists only in the cloud app's emitters. The shared contract has nofull_pageUI mode and no bounded way to say that a capability, a plan or a quote was refused. The billing web facade only acceptsBillingTelemetryEvent.How
@comfyorg/account-core/billing,CheckoutUiModegainsfull_page.enteredcarries an optionalpayment_intent_source.preview_failedgains a boundeddenial_reason(the capability denial) and two checkout codes forerror_code,quote_not_allowedandplan_unavailable. The payload builder forwards them. The cloud app's persisted-journey allowlist acceptsfull_page(one line).billingWebTelemetry.trackCheckoutJourneyEventsends a journey phase to RUM and PostHog under its wire name, stampedbilling_surface: 'billing_web'.trackBillingEventnow shares the same send path and behaves as before. The journey payload comes from the contract's explicit builder, so no other field can pass.useCheckoutJourney(uiMode)owns the identity. The journey id is the entry link'scorrelation_idand a fresh id only for a link that carries none.payment_intent_sourceonenteredis the link'ssource.entry_sourcemaps the link's source into the cloud's coarse enum.entry_flowis the first quote's transition (initial_subscriptionorpaid_upgrade) and readsunknownonentered.assignment_statusisunavailable.enteredfires at setup. Each plain quote reports throughquotePlan: an allowed quote ispreview_ready, a refused quote ispreview_failedwithquote_not_allowed, a failed read ispreview_failedwith a category. Only the newest quote call reports, so an answer the quote composable abandoned for a newer one reports nothing.quotedispreview_ready. A refused capability, an unreadable capability read, an unreadable quote, a refused quote and an unavailable plan arepreview_failed.unavailableandcapabilitiesFailedevents now carry the HTTP status when the server answered.REQUEST_FAILEDisnetworkwithout an HTTP status andapi_rejectedwith one.NOT_AUTHENTICATED,ACCESS_DENIED,NOT_FOUND,CONFLICT,OPERATION_ALREADY_PENDINGandNO_ACTIVE_SUBSCRIPTIONareapi_rejected.INVALID_REQUESTisvalidation. Anything else isunknown.preview_readyfires once per accepted quote revision (quote_id:quote_version), as in the cloud app.Review Focus
a8337f39a4); the base of this PR is main. This PR carries all three parts of FE-3118: its own (E15 and E16, the entry and the quote preview), part 2 (FE-3118 feat(billing-web): report the payment form phases, the submission and the linked operation #19821, E17 and E18) and part 3 (FE-3118 feat(billing-web): report the payment method, promo and blocked-pay choices #19822, E19 to E21 and the three account-ui components that forward the payment method type), which were merged into this branch. It is a sibling of the FE-3117 part 3 (FE-3117 feat(billing-web): report the resubscribe lifecycle #19811) and FE-3115 (FE-3115 feat(billing): report cloud entry points, entry source, top-up amount and the cancel flow as billing events #19815) PRs.entry_sourcevocabulary: billing web maps the link's 15 sources into the cloud's coarse 7-valueentry_sourceenum.agent_paywall,deep_linkandsettings_billing_panel(assettings_billing) keep a name, any other source isother, no source isunknown.payment_intent_sourceonenteredcarries the full source, and it is the field to split by. The cloud reportspricingfor most pricing-dialog entries, so cloud and billing webentry_sourcedo not match for the same journey until FE-3115 unifies the source vocabularies. WideningCheckoutEntrySourcehere instead would break the cloud'ssatisfies Recordallowlist and collide with FE-3115.entry_flowisunknownonentered, because the flow is the quote's and nothing is quoted yet. Join oncheckout_journey_idto read the flow of an entry.enteredagain under the same journey id, so count distinct journey ids. A link change inside a reused checkout view keeps the first id. A journey id minted for a link withoutcorrelation_idusescrypto.randomUUID(), which the SDK already requires for its idempotency keys.UI_MODESchange insrc/platform/workspace/utils/checkoutJourney.tssits near the entry-source work in FE-3115. A code-to-category mapper likefailureCategoryOfmay also appear in FE-3117 for subscribe failures.checkoutPage.tschanges only two event types, which gain an optionalhttpStatus. The reducer is untouched.trackBillingEvent: its body now calls the sharedsend. Its existing tests pass unchanged.UnifiedPricingTable.test.ts("prompts free-tier users to subscribe") fails locally onorigin/maintoo under Node 24. The timing-based tests inrouter.planless.test.ts,billingWebAuth.*andoperationLifecycle.test.tscan time out on a loaded machine and pass alone.0de5cf4218). One conflict, inCheckoutView.vuepay(): the journey hooks (method_selected,submitted) now run first and FE-3117's attempt tracker wraps thecheckout.subscribecall unchanged.CheckoutView.streams.test.tsruns the embedded checkout over the real SDK client with only the network and the RUM sink mocked and pins the order of a successful Pay across the three families:entered,preview_ready,method_selected,submitted, thensubscription_checkout.intentand.started,billing.operation.started,operation_linked,billing.operation.succeededandsubscription_checkout.succeeded, with the four events after the issue sharing onebilling_op_id.192c751f28, red tests first): a Pay refused withOPERATION_ALREADY_PENDINGorCONFLICT, or whose command rejects, no longer lets a later recovered operation be reported asoperation_linked(the journey's wait is cleared per press when its command settles, in both Pay handlers);preview_failedtakes itsfailure_categoryfrom the attempt's mapper, so one refusal has one category in the journey and the attempt funnels (NOT_AUTHENTICATEDwithout a status isnetworkin both); and the negative tests wait on positive signals instead of a timer.AS IS / TO BE
AS IS:
TO BE:
The evidence is the
billing.checkout.*actions RUM receives for an embedded and a full-page checkout (a quote that loads, a refused quote and a denied capability), which are absent before and present after.Where this sits in the plan
Linear: FE-3118, part of FE-3105. Plan, event catalog and dependency graph: action items.
flowchart LR subgraph DEC["Decided"] T1["FE-3107 T1 vocabulary"] T2["FE-3108 T2 RUM app and env"] end subgraph FIX["Existing events (T4)"] F1["FE-3106 F1 SDK-rail ownership"] F2["FE-3110 F2 mapper fields"] F3["FE-3111 F3 surface and client"] F5["FE-3112 F5 top-up terminals"] F6["FE-3113 F6 downgrade terminal"] F7["FE-3114 F7 legacy personal, first slice"] F7B["FE-3131 F7 remaining slices"] C140["FE-3140 event contract to shared package"] end subgraph EMIT["New events"] T3["FE-3109 T3 billing web bootstrap"] T3b["FE-3156 T3+ opaque RUM user id"] T5["FE-3115 T5 cloud entry and parity"] T6["FE-3116 T6 handoff contract"] T7["FE-3117 T7 attempt lifecycle"] T8["FE-3118 T8 journey and choices"] T9["FE-3119 T9 friction"] T10["FE-3120 T10 entry, session, return"] T11["FE-3121 T11 portal"] T12["FE-3122 T12 flag coverage"] end subgraph DASH["Dashboards"] T13["FE-3123 T13 PostHog rollout"] T14["FE-3124 T14 Frontend RUM tiles"] end T15["FE-3125 T15 verification"] T16["FE-3126 T16 rollout plan"] T2 --> T3 T3 --> T3b F3 --> C140 T3 --> C140 C140 --> T7 C140 --> T8 C140 --> T10 C140 --> T11 T1 --> F3 T1 --> T5 T1 --> T6 T1 --> T13 T1 --> T14 T2 --> T14 F2 --> T7 T3 --> T7 T3 --> T8 T3 --> T10 T3 --> T11 T3 --> T12 T5 --> T11 T6 --> T8 T6 --> T10 T7 --> T9 T8 --> T9 F1 --> T13 F3 --> T13 FIX --> T15 T5 --> T15 T9 --> T15 T10 --> T15 T11 --> T15 T12 --> T15 T13 --> T15 T14 --> T15 T13 --> T16 T15 --> T16 style T8 stroke-width:3px