Skip to content

feat(billing): show the bank's decline reason inside the checkout - #15944

Closed
comfydesigner wants to merge 10 commits into
comfydesigner/checkout-3ds-cancelfrom
comfydesigner/checkout-declined-outcome
Closed

comfydesigner wants to merge 10 commits into
comfydesigner/checkout-3ds-cancelfrom
comfydesigner/checkout-declined-outcome

Conversation

@comfydesigner

@comfydesigner comfydesigner commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements 5b Outcome — Declined from Figma 5709-49062. Stacked on #15923.

The design pairs it with success: "Success is terminal (Close). Declined is not: back returns to the confirm step with everything intact for a retry; the Stripe reason shows when the API provides one." Success shipped; declined never did.

This also closes a hole in #15923. That branch's polling watcher already sets checkoutStep = 'declined' and captures the reason on a failed charge, but nothing rendered for it — a refused payment landed on a blank step. This adds the screen that step needs.

  • SubscriptionDeclinedWorkspace.vue — warning icon, "Payment declined", the design's body copy, the Stripe reason block (rendered only when the API supplies one; an empty box reads as a second failure), and "Update payment method".
  • handleDeclinedBack / handleUpdatePayment on the checkout composable — both return to the confirm step with the quote and selection intact and clear the resolved operation. "Update payment method" additionally opens method collection, which is dialog state rather than checkout state.
  • Dialog renders the step with the same chrome as verifying and success.

One deviation to confirm

The design frame shows a single CTA. I added a secondary Back below it, because with the declined step suppressing the dialog header there is otherwise no route back to confirm — only the X, which closes the flow entirely, contradicting "declined is not terminal". Happy to drop it if the intended retry route is the X plus a reopen.

Verification

  • 3 component tests (reason shown / reason absent / both CTAs emit), 1299 workspace tests pass, typecheck clean.
  • Rendered against the Figma frame in Storybook before landing.

Review updates (Sep 2): Back/Update payment method route to the preserved preview only in-flow; a decline recovered on re-entry backs out to plan selection (no quote to land on). Clearing the operation nulls the active pointer. The reason box is labeled "What your bank said" — it carries our mapped rendering of the bank's decline code. The payment step's mobile height cap to min(740px, 85vh) is deliberate: it aligns the one unaligned step with its embedded siblings. The out-of-credits banner is gated to the plan-facing steps. handleUpdatePayment alias removed — the dialog wrapper owns the method-collection choice.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

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

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: d0bb04ba-b0b3-471a-8cb4-fc7b52cf7f41

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

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

📊 Browser Reports
  • chromium: View Report (✅ 1874 / ❌ 0 / ⚠️ 1 / ⏭️ 4)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/03/2026, 01:59:00 AM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.1 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 58.3 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.1 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.7 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.3 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.6 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.9 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 80.9 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.6 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.9 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.1 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 125ms TBT · 82.8 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.8 MB heap
vue-large-graph-idle: · 56.2 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 169.8 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 135ms TBT · 163.2 MB heap
vue-node-resize-workload: · 55.4 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 443ms TBT · 167.6 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.3 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 7ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 500ms
canvas-idle: script duration 9ms
canvas-idle: TBT 0ms
canvas-idle: heap used 62.1 MB
canvas-idle: DOM nodes -282
canvas-idle: event listeners -170
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 5ms
canvas-mouse-sweep: style recalc duration 40ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 78
canvas-mouse-sweep: task duration 883ms
canvas-mouse-sweep: script duration 147ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 58.3 MB
canvas-mouse-sweep: DOM nodes -281
canvas-mouse-sweep: event listeners -155
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 18ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 359ms
canvas-zoom-sweep: script duration 11ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 71.1 MB
canvas-zoom-sweep: DOM nodes 79
canvas-zoom-sweep: event listeners 19
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 8ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 10
dom-widget-clipping: task duration 461ms
dom-widget-clipping: script duration 160ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 71.7 MB
dom-widget-clipping: DOM nodes 16
dom-widget-clipping: event listeners 2
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 4ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 5
large-graph-idle: task duration 596ms
large-graph-idle: script duration 35ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 82.3 MB
large-graph-idle: DOM nodes -272
large-graph-idle: event listeners -184
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 11ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 66
large-graph-pan: task duration 1565ms
large-graph-pan: script duration 774ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 79.6 MB
large-graph-pan: DOM nodes -273
large-graph-pan: event listeners -155
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 13ms
large-graph-zoom: style recalc duration 10ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 60
large-graph-zoom: task duration 1637ms
large-graph-zoom: script duration 740ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 71.9 MB
large-graph-zoom: DOM nodes 0
large-graph-zoom: event listeners 9
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 41
legacy-node-drag: task duration 1849ms
legacy-node-drag: script duration 927ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 80.9 MB
legacy-node-drag: DOM nodes -140
legacy-node-drag: event listeners 188
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 5ms
minimap-idle: layout count 0
minimap-idle: style recalc count 6
minimap-idle: task duration 601ms
minimap-idle: script duration 32ms
minimap-idle: TBT 0ms
minimap-idle: heap used 82.6 MB
minimap-idle: DOM nodes -272
minimap-idle: event listeners -185
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 10ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 410ms
subgraph-dom-widget-clipping: script duration 143ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 83.4 MB
subgraph-dom-widget-clipping: DOM nodes 20
subgraph-dom-widget-clipping: event listeners 8
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 8ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 490ms
subgraph-idle: script duration 8ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 66.9 MB
subgraph-idle: DOM nodes -295
subgraph-idle: event listeners -217
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 35ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 781ms
subgraph-mouse-sweep: script duration 99ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 65.1 MB
subgraph-mouse-sweep: DOM nodes -296
subgraph-mouse-sweep: event listeners -217
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 14ms
subgraph-transition-enter: style recalc duration 31ms
subgraph-transition-enter: layout count 14
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 950ms
subgraph-transition-enter: script duration 33ms
subgraph-transition-enter: TBT 125ms
subgraph-transition-enter: heap used 82.8 MB
subgraph-transition-enter: DOM nodes 13751
subgraph-transition-enter: event listeners 2383
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 39ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 248
viewport-pan-sweep: task duration 5563ms
viewport-pan-sweep: script duration 2508ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 84.8 MB
viewport-pan-sweep: DOM nodes -269
viewport-pan-sweep: event listeners -139
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 17148ms
vue-large-graph-idle: script duration 285ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 169.8 MB
vue-large-graph-idle: DOM nodes -6548
vue-large-graph-idle: event listeners -7473
vue-large-graph-pan: avg frame time 17ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 20ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 171
vue-large-graph-pan: task duration 21606ms
vue-large-graph-pan: script duration 932ms
vue-large-graph-pan: TBT 135ms
vue-large-graph-pan: heap used 163.2 MB
vue-large-graph-pan: DOM nodes -6548
vue-large-graph-pan: event listeners -7467
vue-node-resize-workload: avg frame time 18ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 24ms
vue-node-resize-workload: style recalc duration 74ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 6184ms
vue-node-resize-workload: script duration 114ms
vue-node-resize-workload: TBT 443ms
vue-node-resize-workload: heap used 167.6 MB
vue-node-resize-workload: DOM nodes -6548
vue-node-resize-workload: event listeners -7472
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 16ms
workflow-execution: layout count 3
workflow-execution: style recalc count 10
workflow-execution: task duration 86ms
workflow-execution: script duration 7ms
workflow-execution: TBT 0ms
workflow-execution: heap used 69.3 MB
workflow-execution: DOM nodes 118
workflow-execution: event listeners 74
Raw data
{
  "timestamp": "2026-09-03T02:10:40.806Z",
  "gitSha": "83dec2cf0a168119dec6c9b30eebe92e56d6e139",
  "branch": "comfydesigner/checkout-declined-outcome",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2054.844000000003,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.925999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 494.864,
      "heapDeltaBytes": 2286536,
      "heapUsedBytes": 72612692,
      "domNodes": -281,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 8.676,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-idle",
      "durationMs": 2021.1229999999887,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.416999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 504.93100000000004,
      "heapDeltaBytes": -12065812,
      "heapUsedBytes": 57603884,
      "domNodes": -282,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 8.34,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1925.0169999999684,
      "styleRecalcs": 80,
      "styleRecalcDurationMs": 43.865,
      "layouts": 14,
      "layoutDurationMs": 4.913,
      "taskDurationMs": 926.3100000000001,
      "heapDeltaBytes": -9803148,
      "heapUsedBytes": 59766328,
      "domNodes": -281,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 153.92,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1815.0769999999739,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 36.348,
      "layouts": 14,
      "layoutDurationMs": 4.628,
      "taskDurationMs": 839.912,
      "heapDeltaBytes": -7969740,
      "heapUsedBytes": 62467816,
      "domNodes": -281,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 140.66,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1705.2100000000223,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 20.042,
      "layouts": 6,
      "layoutDurationMs": 1.2389999999999999,
      "taskDurationMs": 368.04099999999994,
      "heapDeltaBytes": 4424072,
      "heapUsedBytes": 74616508,
      "domNodes": 78,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 11.979999999999997,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1670.4859999999826,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 16.278000000000002,
      "layouts": 6,
      "layoutDurationMs": 1.0809999999999997,
      "taskDurationMs": 350.172,
      "heapDeltaBytes": 4437932,
      "heapUsedBytes": 74566356,
      "domNodes": 79,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 10.806,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 756.7070000000058,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.669000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 483.99100000000004,
      "heapDeltaBytes": 17509000,
      "heapUsedBytes": 87708364,
      "domNodes": 14,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 166.489,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 647.4719999999934,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 7.906,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 437.847,
      "heapDeltaBytes": -7808096,
      "heapUsedBytes": 62735336,
      "domNodes": 18,
      "jsHeapTotalBytes": 6029312,
      "scriptDurationMs": 153.363,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2050.161000000003,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 3.7509999999999972,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 587.117,
      "heapDeltaBytes": 10819216,
      "heapUsedBytes": 86516548,
      "domNodes": -271,
      "jsHeapTotalBytes": -1921024,
      "scriptDurationMs": 31.55,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2034.0099999999666,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 3.788,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 605.465,
      "heapDeltaBytes": 10229516,
      "heapUsedBytes": 86104124,
      "domNodes": -273,
      "jsHeapTotalBytes": -1921024,
      "scriptDurationMs": 37.889,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2230.858000000012,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 11.289,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1621.3959999999997,
      "heapDeltaBytes": -15435748,
      "heapUsedBytes": 86291780,
      "domNodes": -273,
      "jsHeapTotalBytes": -872448,
      "scriptDurationMs": 809.388,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2139.4940000000133,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 11.081999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1508.9360000000001,
      "heapDeltaBytes": 14917156,
      "heapUsedBytes": 80659872,
      "domNodes": -272,
      "jsHeapTotalBytes": 225280,
      "scriptDurationMs": 738.042,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3564.0249999999583,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 10.397,
      "layouts": 60,
      "layoutDurationMs": 12.553999999999998,
      "taskDurationMs": 1648.593,
      "heapDeltaBytes": 8030996,
      "heapUsedBytes": 75277976,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 746.0870000000001,
      "eventListeners": 10,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3418.851000000018,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 10.404,
      "layouts": 60,
      "layoutDurationMs": 12.820000000000002,
      "taskDurationMs": 1624.851,
      "heapDeltaBytes": 8466996,
      "heapUsedBytes": 75532160,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 733.537,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3037.085999999988,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 5.244999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1866.2930000000001,
      "heapDeltaBytes": 17100332,
      "heapUsedBytes": 84483420,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 942.255,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.660000000000007,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3011.9600000000446,
      "styleRecalcs": 41,
      "styleRecalcDurationMs": 6.003000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1830.823,
      "heapDeltaBytes": 18437844,
      "heapUsedBytes": 85229300,
      "domNodes": -280,
      "jsHeapTotalBytes": 2252800,
      "scriptDurationMs": 911.691,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2043.8690000000292,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 5.507999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 597.925,
      "heapDeltaBytes": 10076056,
      "heapUsedBytes": 86629412,
      "domNodes": -269,
      "jsHeapTotalBytes": -2445312,
      "scriptDurationMs": 31.901,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2046.3039999999637,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 3.895999999999997,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 604.033,
      "heapDeltaBytes": 9954936,
      "heapUsedBytes": 86544640,
      "domNodes": -275,
      "jsHeapTotalBytes": -1396736,
      "scriptDurationMs": 31.768000000000004,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 606.9590000000176,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 10.004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 417.08,
      "heapDeltaBytes": 14777820,
      "heapUsedBytes": 87562856,
      "domNodes": 20,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 145.969,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 577.0880000000034,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 9.824,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 402.845,
      "heapDeltaBytes": 14845900,
      "heapUsedBytes": 87408560,
      "domNodes": 20,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 139.346,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2013.1510000000503,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.122,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 492.83200000000005,
      "heapDeltaBytes": -8269088,
      "heapUsedBytes": 64281780,
      "domNodes": -293,
      "jsHeapTotalBytes": 5496832,
      "scriptDurationMs": 7.765999999999998,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2008.4410000000616,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 7.799,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 487.311,
      "heapDeltaBytes": 3541016,
      "heapUsedBytes": 75974832,
      "domNodes": -297,
      "jsHeapTotalBytes": 5496832,
      "scriptDurationMs": 7.731999999999999,
      "eventListeners": -231,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1707.0769999999698,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 34.969,
      "layouts": 18,
      "layoutDurationMs": 5.549999999999999,
      "taskDurationMs": 785.486,
      "heapDeltaBytes": -11257116,
      "heapUsedBytes": 60992144,
      "domNodes": -296,
      "jsHeapTotalBytes": 4448256,
      "scriptDurationMs": 97.63000000000001,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1716.1800000000085,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 34.428,
      "layouts": 18,
      "layoutDurationMs": 4.724,
      "taskDurationMs": 776.4649999999999,
      "heapDeltaBytes": 3204656,
      "heapUsedBytes": 75524464,
      "domNodes": -295,
      "jsHeapTotalBytes": 6545408,
      "scriptDurationMs": 99.759,
      "eventListeners": -233,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1401.3630000000603,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 30.916999999999994,
      "layouts": 14,
      "layoutDurationMs": 14.307000000000004,
      "taskDurationMs": 950.4749999999999,
      "heapDeltaBytes": -5421328,
      "heapUsedBytes": 86861420,
      "domNodes": 13751,
      "jsHeapTotalBytes": 11010048,
      "scriptDurationMs": 32.60900000000001,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 125,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8407.28200000001,
      "styleRecalcs": 247,
      "styleRecalcDurationMs": 38.874,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5530.153,
      "heapDeltaBytes": -11266920,
      "heapUsedBytes": 89339888,
      "domNodes": -268,
      "jsHeapTotalBytes": -1396736,
      "scriptDurationMs": 2485.272,
      "eventListeners": -139,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8445.856999999933,
      "styleRecalcs": 248,
      "styleRecalcDurationMs": 38.443,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5595.991000000001,
      "heapDeltaBytes": -12046480,
      "heapUsedBytes": 88466816,
      "domNodes": -269,
      "jsHeapTotalBytes": -1134592,
      "scriptDurationMs": 2531.604,
      "eventListeners": -139,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17904.042000000005,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17115.984,
      "heapDeltaBytes": -30653280,
      "heapUsedBytes": 179114360,
      "domNodes": -6548,
      "jsHeapTotalBytes": 2228224,
      "scriptDurationMs": 286.126,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17928.739999999947,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17180.272,
      "heapDeltaBytes": -32838772,
      "heapUsedBytes": 176926072,
      "domNodes": -6548,
      "jsHeapTotalBytes": -655360,
      "scriptDurationMs": 283.10200000000003,
      "eventListeners": -7475,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 21616.403999999988,
      "styleRecalcs": 163,
      "styleRecalcDurationMs": 19.072000000000035,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 21333.591,
      "heapDeltaBytes": -36614948,
      "heapUsedBytes": 179896128,
      "domNodes": -6548,
      "jsHeapTotalBytes": 1302528,
      "scriptDurationMs": 919.3,
      "eventListeners": -7467,
      "totalBlockingTimeMs": 63,
      "frameDurationMs": 17.220000000000073,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 22221.389999999927,
      "styleRecalcs": 178,
      "styleRecalcDurationMs": 21.303999999999988,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 21877.978000000003,
      "heapDeltaBytes": -39637028,
      "heapUsedBytes": 162449576,
      "domNodes": -6548,
      "jsHeapTotalBytes": 2351104,
      "scriptDurationMs": 943.869,
      "eventListeners": -7467,
      "totalBlockingTimeMs": 207,
      "frameDurationMs": 17.776666666666763,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6312.140999999997,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 73.10100000000003,
      "layouts": 20,
      "layoutDurationMs": 24.248000000000005,
      "taskDurationMs": 6216.487,
      "heapDeltaBytes": -26183960,
      "heapUsedBytes": 176706272,
      "domNodes": -6548,
      "jsHeapTotalBytes": 12603392,
      "scriptDurationMs": 117.333,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 436,
      "frameDurationMs": 18.33666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6240.110999999956,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 75.11399999999996,
      "layouts": 20,
      "layoutDurationMs": 24.521,
      "taskDurationMs": 6152.192,
      "heapDeltaBytes": -27731328,
      "heapUsedBytes": 174713276,
      "domNodes": -6548,
      "jsHeapTotalBytes": 12075008,
      "scriptDurationMs": 109.866,
      "eventListeners": -7473,
      "totalBlockingTimeMs": 449,
      "frameDurationMs": 17.776666666666703,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 99.53999999993357,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 12.926000000000002,
      "layouts": 2,
      "layoutDurationMs": 0.5979999999999998,
      "taskDurationMs": 71.317,
      "heapDeltaBytes": 3244212,
      "heapUsedBytes": 71884476,
      "domNodes": 112,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 5.835000000000002,
      "eventListeners": 49,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "workflow-execution",
      "durationMs": 466.35600000001887,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 19.339999999999996,
      "layouts": 3,
      "layoutDurationMs": 0.8599999999999999,
      "taskDurationMs": 101.217,
      "heapDeltaBytes": 5049388,
      "heapUsedBytes": 73397128,
      "domNodes": 123,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 7.523000000000001,
      "eventListeners": 99,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 48051 70561 68.1% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.1% 1188
src/LGraphNode.ts 69.4% 397
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.0% 343
src/platform/workspace/stores/billingOperationStore.ts 7.8% 321
src/platform/workspace/stores/workspaceAuthStore.ts 36.0% 288
src/platform/workspace/stores/teamWorkspaceStore.ts 37.7% 261
src/LGraph.ts 78.4% 258
src/scripts/app.ts 71.6% 250
src/scripts/pnginfo.ts 21.4% 221
src/stores/assetsStore.ts 44.7% 204

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nents/SubscriptionRequiredDialogContentUnified.vue 25.00% 6 Missing ⚠️
@@                         Coverage Diff                          @@
##             comfydesigner/checkout-3ds-cancel   #15944   +/-   ##
====================================================================
  Coverage                                     ?   82.30%           
====================================================================
  Files                                        ?     2020           
  Lines                                        ?   116785           
  Branches                                     ?    32356           
====================================================================
  Hits                                         ?    96117           
  Misses                                       ?    20490           
  Partials                                     ?      178           
Flag Coverage Δ
e2e 68.09% <ø> (?)
unit 76.62% <81.81%> (?)

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

Files with missing lines Coverage Δ
...space/components/SubscriptionDeclinedWorkspace.vue 100.00% <100.00%> (ø)
...m/workspace/composables/useSubscriptionCheckout.ts 88.85% <100.00%> (ø)
...nents/SubscriptionRequiredDialogContentUnified.vue 52.45% <25.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comfydesigner
comfydesigner force-pushed the comfydesigner/checkout-declined-outcome branch from 09c5f8a to 2aad3b1 Compare August 26, 2026 00:38
@comfydesigner comfydesigner added the cursor-review Trigger multi-model Cursor agent review on this PR label Sep 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Cursor Review — Consolidated panel

Triggered by @comfydesigner.

Found 6 finding(s).

Severity Count
🟠 High 1
🟡 Medium 2
🟢 Low 3

Panel: 8/8 reviewers contributed findings.

checkoutDeclineReason.value = null
const opId = activeCheckoutOperation.value?.opId
if (opId) billingOperationStore.clearOperation(opId)
checkoutStep.value = 'preview'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 High — declined is only entered from the verifying watcher, and verifying is only the initial step on re-entry with a recovered pending operation — a path where previewData, selectedTierKey, and selectedTeamCheckout are all still null. Forcing checkoutStep to 'preview' therefore leaves previewVariant null, so none of the branches under <template v-if="checkoutStep === 'preview'"> render and both declined CTAs (Back, and Update payment method which delegates here) strand the user on an empty dialog with only the back arrow as an escape. Fall back to 'pricing' when there is no preserved quote/selection, the way handleCancelPendingPayment and the success branch already guard this exact case.

Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case, kimi-k3-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f3600d4 — back routes to 'preview' only when previewData is preserved, else to plan selection; composable tests cover both entry paths.

/>

<SubscriptionDeclinedWorkspace
v-if="checkoutStep === 'declined'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium — The declined screen is shown for any operation in the terminal failed status, which the billing store also uses for checkout_superseded (deliberately not surfaced, since its replacement is proceeding normally) and for backend/network/system failures. Those cases now get a full-screen "Payment declined" that blames the customer's bank and offers a payment-method fix that cannot address the real error; gate the transition on a provider-decline category, or use generic failure copy.

Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partly guarded already, fully addressed one PR up. Superseded operations can't reach this screen: supersession only happens when a new attempt has replaced the active operation, and both routing sites guard on the active operation id, so the superseded op is no longer the one being watched. Backend/system failures do land here on this branch with the generic mapped copy; the classification that splits them arrives in #16571 (stacked on this), where processing-class failures get their own outcome screen with Try again and no payment-method CTA. The residual default — unknown code → declined — is deliberate: an unrecognized failure on a charge is most likely the charge.

<span class="text-sm text-muted-foreground">
{{ $t('subscription.declined.reasonLabel') }}
</span>
<span class="text-sm text-base-foreground">{{ declineReason }}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium — checkoutDeclineReason comes from the operation's errorMessage, which handleFailure fills with the first-party billingFailureDetail(...) i18n string (falling back to "We couldn't update your subscription. Please try again."), never the processor's text — so labeling it "Stripe reasoning:" attributes our own copy to Stripe. Since that value is never empty for a failed subscription op, the v-if always renders and usually just restates the body text, meaning the null case the unit test covers cannot occur in production.

Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Label fixed in f3600d4: "What your bank said" (the copy the Outcome Screens design uses) — the box carries our mapped rendering of the bank's decline code, so attributing it to Stripe was wrong on both ends. The always-renders point stands for the generic fallback until #16571's failure classification lands; with it, the verdict-class codes are the ones that reach this screen with a reason.

function handleDeclinedBack() {
checkoutDeclineReason.value = null
const opId = activeCheckoutOperation.value?.opId
if (opId) billingOperationStore.clearOperation(opId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low — clearOperation(opId) removes the record but leaves activeCheckoutOperationId pointing at the deleted id, unlike the sibling cleanup paths resetToPricing() and handleCancelPendingPayment(), which both null it right after removing the operation. Because activeCheckoutOperation only falls back to billingOperationStore.subscriptionActionOperation when that ref is null, the dialog stays blind to any other subscription operation (e.g. a reconciliation_needed op) until a new subscribe overwrites the id.

Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f3600d4 — handleDeclinedBack nulls activeCheckoutOperationId right after clearOperation, matching resetToPricing and handleCancelPendingPayment.

!isEmbeddedConfirmStep &&
!isVerifyingStep
!isVerifyingStep &&
!isDeclinedStep

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low — This adds the declined step to the "Choose a Plan" header guard, but the v-if="reason === 'out_of_credits'" block just below it has no step gating, so a dialog opened from an out-of-credits prompt stacks "Insufficient credits" above "Payment declined" inside a fixed-height overflow-hidden panel. The verifying and success steps already have the same omission, so gating that block on the step is a better fix than adding another negation here.

Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Took the better fix as suggested: the out-of-credits block is now positively gated on the plan-facing steps (pricing/preview), which also covers the pre-existing verifying/success stacking.

expect(screen.getByText('Payment declined')).toBeInTheDocument()
})

it('offers a retry rather than ending the flow', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low — The name promises a flow-level guarantee, but the test only asserts that the child emits updatePayment and back — nothing covers where the parent's handleDeclinedBack actually lands, which is exactly where the retry dead-ends on the preview step. Asserting the resulting checkoutStep in a useSubscriptionCheckout or dialog-level test would catch that.

Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right level, wrong file — added the flow-level assertions to the composable suite in f3600d4: in-flow back lands on the preserved preview, recovered back lands on pricing. The component test keeps asserting only what the child owns (its emits).

@huang47 huang47 added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is the right screen and it does close the hole I flagged on #15923 — good catch calling that out explicitly in the description rather than letting the two PRs quietly depend on each other.

One blocking issue: the retry route out of this step reproduces the same class of dead end one layer up. On the re-entry path there's no selection or preview to return to, and handleDeclinedBack sends the customer to 'preview' anyway. Detail inline.

Also answered your "one deviation to confirm" question inline — short version, keep the Back button.

I checked and dropped one concern that turned out to be unfounded: I thought checkoutDeclineReason could surface a raw client-side exception string under the "Stripe reasoning:" label, since setAuthenticationRetry writes error.message into errorMessage. It can't — handleFailure routes through updateOperationStatus(opId, 'failed', detail ?? defaultMessage) (billingOperationStore.ts:761), which overwrites errorMessage with the server-derived detail before status ever reaches 'failed'. Noting it so you don't have to re-derive it.

Comment on lines +928 to +932
function handleDeclinedBack() {
checkoutDeclineReason.value = null
const opId = activeCheckoutOperation.value?.opId
if (opId) billingOperationStore.clearOperation(opId)
checkoutStep.value = 'preview'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue (blocking): 'preview' isn't always a step the customer can return to, and this routes there unconditionally.

The declined step has two entry paths:

  1. In-flow — customer picked a plan in this dialog session, so selectedTierKey and previewData are populated. Returning to 'preview' works exactly as described.
  2. Re-entry — the dialog opened onto 'verifying' because a pending 3DS operation was recovered from the store (feat(billing): see and cancel a payment your bank is still verifying #15923, useSubscriptionCheckout.ts:156). The operation polls to failed, the watcher sets 'declined'. There is no selectedTierKey and previewData is still null — nothing was ever previewed in this session.

On path 2, handleDeclinedBack sets checkoutStep = 'preview' and previewVariant returns null (line 680: no selectedTeamCheckout, no previewData). Every v-if inside <template v-if="checkoutStep === 'preview'"> tests previewVariant, so all four are false and the dialog renders empty — the same blank-step failure this PR exists to fix, just moved one click later.

The sibling branch in that same watcher already handles this asymmetry:

if (status === 'succeeded') {
  if (selectedTierKey.value || isTeamCheckout.value) {
    checkoutStep.value = 'success'
  } else {
    emit('close', true)   // nothing to show — don't strand them
  }

Could the declined back path take the same shape? Something like: return to 'preview' when there's a selection to return to, otherwise 'pricing' — which for a re-entry decline is arguably the more useful landing anyway, since the customer needs to re-pick a plan regardless. 'pricing' also renders correctly with no preview state, so it can't blank.

Same applies to handleUpdatePayment at line 938, since it delegates here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in f3600d4: back now routes to 'preview' only when previewData is preserved, otherwise to plan selection — a recovered decline has no quote to land on, so pricing is the only step that can host it. Composable tests pin both directions (in-flow → preview, re-entry → pricing), and clearing the operation now also nulls the active pointer so the dialog isn't blind to a later operation.

variant="muted-textonly"
size="lg"
class="w-full rounded-lg"
@click="$emit('back')"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question → answered: you asked whether to keep this secondary Back or rely on the X plus a reopen. I'd keep it.

The X isn't equivalent here. With the declined step suppressing the dialog header, closing is the only other route, and on reopen the customer doesn't land back where they were — #15923's initializer reads subscriptionActionOperation, the failed operation no longer matches (the selector takes pending and reconciliation_needed only), so they land on 'pricing' and start over. That directly contradicts the design note you quoted — "Declined is not terminal: back returns to the confirm step with everything intact for a retry." The X gives them terminal-with-extra-steps.

So the deviation is the design being honored rather than departed from. Worth saying that in the Figma thread rather than dropping the button.

(One caveat: "everything intact" only holds on the in-flow path — see my comment on handleDeclinedBack. Once that's guarded, this reasoning is clean.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed and keeping it — and your re-entry analysis is now doubly load-bearing, since Back's destination depends on exactly that distinction (see the routing fix above).

isDeclinedStep) &&
'max-xl:w-[min(430px,92vw)]',
isEmbeddedPaymentStep && 'max-xl:h-[85vh]'
isEmbeddedPaymentStep && 'max-xl:h-[min(740px,85vh)]'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: This changes the embedded payment step's mobile height (max-xl:h-[85vh] → max-xl:h-[min(740px,85vh)]), which is a different step from the one this PR adds and isn't mentioned in the description.

It caps the payment step at 740px on tall phones where 85vh previously exceeded that. Plausibly a deliberate alignment with the other embedded steps — they all use min(740px,...) — but I'd rather not infer it.

Is it intentional? If yes, could you add a line to the description so it isn't read as a stray edit during a bisect later. If it's incidental, dropping it keeps this PR to the declined step.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deliberate, and you're right it belonged in the description — added. It caps the payment step at 740px on tall phones to match the min(740px,…) treatment every other embedded step already uses; without it the payment step was the one screen that could grow past its siblings.

// "Update payment method" lands on the same confirm step; the caller decides
// to collect a new method rather than reuse the one the bank refused, since
// that selection lives with the dialog.
function handleUpdatePayment() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion (non-blocking): handleUpdatePayment is currently an exact alias of handleDeclinedBack, and both are exported. The behavioral difference lives entirely in the dialog wrapper (handleDeclinedUpdatePayment → selectSavedPaymentMethod(null)), which the comment explains well.

Since the composable can't distinguish them, exporting two names invites a future caller to pick the wrong one and get silently different behavior depending on which host wires it. Either export one function and let the dialog own the method-collection difference, or give this one the selectSavedPaymentMethod(null) responsibility so the names mean different things.

Not blocking — just that two identical exported functions is a seam that tends to drift.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in f3600d4 — the composable exports only handleDeclinedBack, and the dialog wrapper composes the method-collection choice itself. The comment explaining why that choice lives with the dialog moved onto the wrapper.

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed at e2832200 (was 7c97ea69). Every finding from the previous round is resolved, and the fixes are the right ones rather than the minimal ones. Verified in code:

  • Back routing (useSubscriptionCheckout.ts:941) — checkoutStep.value = previewData.value ? 'preview' : 'pricing'. A recovered decline has no quote to land on and now goes to plan selection instead of a preview step where every v-if is false. Both directions pinned by tests: backs out of an in-flow decline to the preserved preview and backs out of a recovered decline to plan selection, not a blank preview.
  • Stale pointer — activeCheckoutOperationId.value = null right after clearOperation, matching resetToPricing and handleCancelPendingPayment.
  • Duplicate exports — handleUpdatePayment is gone entirely (0 references); the dialog wrapper owns the method-collection difference. The seam I was worried about no longer exists.
  • Out-of-credits stacking — now positively gated: reason === 'out_of_credits' && (checkoutStep === 'pricing' || checkoutStep === 'preview'). That's the better fix; it also closes the pre-existing verifying/success case rather than just the one I happened to name.
  • max-xl:h-[min(740px,85vh)] — confirmed deliberate and now in the description.
  • Decline reason label — "What your bank said" instead of attributing it to Stripe.

The door-and-room problem from #15923 is correctly resolved here: this PR now carries both the 'declined' transition and SubscriptionDeclinedWorkspace, so each PR in the stack renders every state it can enter. That was the right call over merging the two as a unit.

On the residual default (unknown failure code → declined): agreed it's the reasonable prior, and I'll pick up the processing-class split when I review #16571.

Approving. Nothing outstanding from my side.

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 3, 2026
@comfydesigner comfydesigner changed the title feat(billing): declined outcome step for a refused checkout charge feat(billing): show the bank's decline reason inside the checkout Sep 3, 2026

@dante01yoon dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Following up on my approval — new CI evidence has landed since, so I want to flag it rather than leave the approval standing unqualified. No new code review here; everything I raised on Sep 2 is still resolved and the head is unchanged (08905b2a).

Unanchored

browser_tests/tests/dialogs/checkout3dsStates.spec.ts:167 › Checkout 3DS verifying re-entry › cancel returns to plan selection @cloud is failing on this head, and it fails all 3 retries — not a flake.

Timing is why I missed it: I approved at 21:05Z on Sep 2, and the run that caught this (33705704392) started 01:57Z on Sep 3, about five hours later. Same commit, later run.

What I could narrow down:

  • The test doesn't exist on main — this stack added it.
  • It fails here, on #16571, and on #16848 — the whole checkout-3ds-cancel lineage above #15923.
  • It does not fail on #16561, which sits on the other branch, so it isn't environmental.
  • I couldn't clear #15923 either way: its latest head (34861f99) hasn't had the e2e job run at all, so "no failures" there means "not measured", not "passing".

That leaves this PR as the first place in the lineage where the failure is actually observed, which makes it the most likely origin. The test drives re-entry → Cancel payment → expects the Choose a Plan heading, and this PR touched both the header guard (adding isDeclinedStep) and the step-routing around re-entry, so there's a plausible mechanism.

Could you take a look? If it turns out to originate in #15923, that's worth saying here so the stack above it stops inheriting a red suite.

(creditsTile.spec.ts:489 also fails, but it fails on both lineages including #16561, so that one reads as environmental.)

My approval stands on the code as reviewed; I'd just want this green before it merges.

huntcsg added a commit that referenced this pull request Sep 4, 2026
## Summary

"Retry verification" was a no-op that reported itself as a success, so a
failed 3DS challenge put the customer in a loop; this removes the
affordance and restricts `handleNextAction` to the one state it is
correct for.

## Changes

- **What**: `stripe.handleNextAction()` resumes an *in-progress*
challenge. After a failed one the PaymentIntent is
`requires_payment_method` with `next_action: null`, so the call resolves
with no error and no effect — which `runPaymentIntentAction` read as
success, set `authenticationState: 'processing'`, and let the next poll
re-derive `failed_retryable`. The button came back and the customer
looped. A tester on `test-v2` hit exactly that.

Retry is a fresh attempt, not a re-confirmation of the existing intent,
so the fix is a removal:

- `retryPaymentAuthentication` now requires `authenticationState ===
'requires_action'`; `canRetryAuthentication` is derived for
`requires_action` alone. A failed challenge or a plain decline never
offers to resume.
- On the surviving path, an intent that resolves *without advancing*
past its pre-challenge status is reported as failed rather than
`processing` (`RESUMED_INTENT_STATUSES`). The intent can move between
poll and click, so the assertion is on the returned status, not on the
pre-call state.
- `setAuthenticationRetry` → `setAuthenticationFailed`; its `canRetry`
parameter is gone, since the answer is now always no.
- Preview components (`SubscriptionAddPaymentPreviewWorkspace.vue`,
`SubscriptionTransitionPreviewWorkspace.vue`) lose the retry button, the
`retryAuthentication` emit, and the `canRetryAuthentication` /
`isAuthenticating` props — `isAuthenticating` existed only to spin that
button. The failure alert stays.
- Both dialog hosts (`SubscriptionRequiredDialogContentUnified.vue`,
`SubscriptionRequiredDialogContentWorkspace.vue`) drop the corresponding
bindings, and `useSubscriptionCheckout` drops the now-unused
`canRetryAuthentication` / `isAuthenticating` /
`retryPaymentAuthentication` exports.
- `TopUpCreditsDialogContentWorkspace.vue` keeps the in-page resume,
because `requires_action` is the case it is correct for — relabelled
`completeVerification`, and `topupActionOperation` now selects on
`authenticationState` so a failed top-up still shows its error instead
of dropping out of the dialog.
- `billingOperation.retryVerification` and the now-unreachable
`billingOperation.authenticationManagerRequired` are removed from all 15
locale files. Non-en locales are generated, and `pnpm locale:check`
reports `0 prunable keys` against this diff — the manual removal matches
what `pnpm locale` would prune.

- **Breaking**: none for users; the removed affordance never worked.

## Review Focus

**A deliberately removed assertion.** `billingOperationStore.test.ts`
previously asserted retry was offered for `decline_reason:
'card_declined'` and that `retryPaymentAuthentication` resolved `true`
there. That is the incoherence this ticket dissolves — a decline is not
a resumable challenge, and `handleNextAction` can never satisfy one. The
test is kept and inverted: the decline detail is still surfaced, retry
resolves `false`, and Stripe is never called. Every other assertion
about the `failed_retryable` presentation (error text persists, polling
continues, Stripe is not relaunched automatically) is preserved.

**The test that would have caught this** is `reports a resume that
returns an unmoved intent as failed, not processing` in
`billingOperationStore.test.ts` — `handleNextAction` resolves `{
paymentIntent: { status: 'requires_payment_method' } }` with no error.
Every pre-existing test mocked either a clean success or an explicit
error, which is the gap the defect shipped through. Verified red before
the guard (`authenticationState: "processing"`), green after.

**`failed_retryable` still has no in-dialog next step on `main`.** The
design routes it to the declined step, which arrives with #15923 (which
sets `checkoutStep = 'declined'` on a failed charge) and #15944 (which
renders it). Neither exists here, so this PR stops at the removal rather
than inventing a step those branches own. `verificationRecoveryActive`
is left alone for the same reason.

**Overlaps in flight.** #15923 touches `billingOperationStore.ts`, both
preview components, `SubscriptionRequiredDialogContentUnified.vue`,
`useSubscriptionCheckout.ts` and `en/main.json`; #15944 touches the last
two; #15942 touches `SubscriptionAddPaymentPreviewWorkspace.vue`.
Whichever lands second will need a rebase.

The store field is still named `canRetryAuthentication` even though it
now means "the live challenge can be resumed in page". Renaming it would
touch the store, the top-up dialog and ~20 test assertions, and widen
the conflict surface with the three open branches, so it is left for a
follow-up.


## Follow-ups since the original description

- `TopUpCreditsDialogContentWorkspace.vue` gained a dedicated "Start
over" control for `failed_retryable` (`ddaf8761c5`,
`9966ba07`→`31b3547774`, `4700fe8a43`), addressing the
permanently-disabled/spinning verification button dante01yoon flagged in
review. `isAddingCredits` excludes `failed_retryable` so a fresh attempt
isn't locked out.
- `SubscriptionAddPaymentPreviewWorkspace.vue` /
`SubscriptionTransitionPreviewWorkspace.vue`'s "Complete verification"
button now also excludes `failed_retryable` (`ed0cfefea4`) — the
retry-removal simplification had dropped that exclusion, so a stale
`actionUrl` from an abandoned challenge could show the button next to
the failure alert.
- Fixed a `displayState` masking bug (`ff8d647278`): a genuinely new
server-issued challenge (fresh client secret) was being permanently
masked as `failed_retryable` once an operation had failed once, so the
one case where resume used to work stopped working. The mask now only
holds while the secret is unchanged.
- Fixed the topup verifying-step watcher not observing `canTopUp`
(`0ccad0db74`), and a naming cleanup dropping the `isPolling` alias for
`isAddingCredits` (`5a0ff6d33a`).
- **"Start over" no longer discards the operation client-side**
(`bdd50937ea`): `startOverTopup` now calls a new `dismissOperation`,
which sets a `dismissed` flag instead of deleting the operation. Polling
continues and a late success/failure still resolves normally;
`dismissed` only excludes the operation from the `topupActionOperation`
/ `isAddingCredits` selectors a dialog reads. A server-side cancel
(BE-10064/BE-11559) would let a dismissal actually end the operation;
noted in a code comment for when that lands.
- **`RESUMED_INTENT_STATUSES` inverted to `UNMOVED_INTENT_STATUSES`**
(`bdd50937ea`/`bf2632f764`): now a denylist of the three statuses that
mean the intent didn't move (`requires_payment_method`,
`requires_action`, `canceled`) instead of an allowlist of "advanced"
ones. An unlisted or future Stripe status — including the
previously-ambiguous `requires_confirmation` — now resolves
optimistically to `processing` and lets the next poll's server-derived
`authentication_state` correct it, rather than reporting a live payment
as failed.

**Regression coverage**: this fix is entirely covered at the Vitest
unit/component level (`billingOperationStore.test.ts`,
`TopUpCreditsDialogContentWorkspace.test.ts`, and the preview component
tests) rather than with a new Playwright spec. A 3DS challenge
round-trips through Stripe's own hosted UI, which isn't something this
repo's Playwright setup drives end-to-end today (no existing spec
exercises a real or mocked 3DS challenge); the unit-level coverage
exercises every branch of the actual state machine this PR changes
(`displayState` masking, `canRetryAuthentication` gating, the dialog's
step transitions) more precisely than an E2E spec could without a much
larger mocking investment. dante01yoon accepted this rationale.

**Screenshots — outstanding, explicit merge gate per dante01yoon**: I
can't produce the requested AS-IS/TO-BE captures myself — driving a real
3DS challenge needs a live Stripe test environment and cloud backend
connectivity this sandbox doesn't have. Per review, this PR should not
merge until someone with that access posts into this description:
- **TO BE (subscription previews)** — button gone, alert intact (a
rendered component state; doesn't need a real challenge).
- **TO BE (top-up `failed_retryable` + "Start over")** —
`TopUpCreditsDialogContentWorkspace.test.ts` already mounts exactly this
state (doesn't need a real challenge either).
- **AS IS (the loop on `main`)** — needs the live environment; this is
the one that shows the actual defect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Trigger multi-model Cursor agent review on this PR risk:R3 PR risk grade (advisory shadow check; grader-owned) risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants