Skip to content

[backport cloud/1.52] fix(billing): restore Resubscribe on the legacy rail and centralize the policy - #16091

Merged
dante01yoon merged 1 commit into
cloud/1.52from
backport-15967-to-cloud-1.52
Aug 27, 2026
Merged

dante01yoon merged 1 commit into
cloud/1.52from
backport-15967-to-cloud-1.52

Conversation

@dante01yoon

Copy link
Copy Markdown
Collaborator

Backport of #15967 to cloud/1.52.

Merge order — this PR is stacked

Base is deliberately backport-15675-to-cloud-1.52, not cloud/1.52. GitHub retargets this PR to cloud/1.52 once its parent merges.

cloud/1.52 → #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067

Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack.

Verification

Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (src/platform/workspace, src/platform/cloud/subscription, src/composables/useCoreCommands.test.ts, src/components/actionbar).

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (2)
  • [release]
  • [backport

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: Pro Plus

Run ID: b8c81ade-b7e7-4b0e-bcae-07851700a021

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

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1984 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1963 / ❌ 0 / ⚠️ 2 / ⏭️ 5)
  • 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: 08/27/2026, 03:11:14 PM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.0 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 59.8 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.1 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.1 MB heap
large-graph-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.8 MB heap
large-graph-pan: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.2 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.7 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.6 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.3 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.2 MB heap
subgraph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.2 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.2 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 138ms TBT · 81.9 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 75.5 MB heap
vue-large-graph-idle: · 56.3 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 172.9 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 38ms TBT · 175.9 MB heap
workflow-execution: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 62.4 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 7ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 487ms
canvas-idle: script duration 6ms
canvas-idle: TBT 0ms
canvas-idle: heap used 76.0 MB
canvas-idle: DOM nodes -281
canvas-idle: event listeners -151
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 3ms
canvas-mouse-sweep: style recalc duration 34ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 74
canvas-mouse-sweep: task duration 838ms
canvas-mouse-sweep: script duration 109ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 59.8 MB
canvas-mouse-sweep: DOM nodes -284
canvas-mouse-sweep: event listeners -166
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 17ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 32
canvas-zoom-sweep: task duration 346ms
canvas-zoom-sweep: script duration 9ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 63.1 MB
canvas-zoom-sweep: DOM nodes 78
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 6ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 10
dom-widget-clipping: task duration 368ms
dom-widget-clipping: script duration 58ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 70.1 MB
dom-widget-clipping: DOM nodes 15
dom-widget-clipping: event listeners 1
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 7ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 8
large-graph-idle: task duration 591ms
large-graph-idle: script duration 14ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 67.8 MB
large-graph-idle: DOM nodes -283
large-graph-idle: event listeners -150
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 14ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 69
large-graph-pan: task duration 1180ms
large-graph-pan: script duration 334ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 61.2 MB
large-graph-pan: DOM nodes -284
large-graph-pan: event listeners -151
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 7ms
large-graph-zoom: style recalc duration 15ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 66
large-graph-zoom: task duration 1329ms
large-graph-zoom: script duration 383ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 64.7 MB
large-graph-zoom: DOM nodes -137
large-graph-zoom: event listeners -73
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 9ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 46
legacy-node-drag: task duration 1386ms
legacy-node-drag: script duration 450ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 76.6 MB
legacy-node-drag: DOM nodes 11
legacy-node-drag: event listeners 186
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 7ms
minimap-idle: layout count 0
minimap-idle: style recalc count 8
minimap-idle: task duration 594ms
minimap-idle: script duration 15ms
minimap-idle: TBT 0ms
minimap-idle: heap used 65.3 MB
minimap-idle: DOM nodes -284
minimap-idle: event listeners -179
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 13ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 48
subgraph-dom-widget-clipping: task duration 396ms
subgraph-dom-widget-clipping: script duration 125ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 71.2 MB
subgraph-dom-widget-clipping: DOM nodes 21
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 7ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 9
subgraph-idle: task duration 483ms
subgraph-idle: script duration 6ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 67.2 MB
subgraph-idle: DOM nodes -281
subgraph-idle: event listeners -166
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 4ms
subgraph-mouse-sweep: style recalc duration 33ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 76
subgraph-mouse-sweep: task duration 770ms
subgraph-mouse-sweep: script duration 82ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 70.2 MB
subgraph-mouse-sweep: DOM nodes -280
subgraph-mouse-sweep: event listeners -167
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 19
subgraph-transition-enter: task duration 925ms
subgraph-transition-enter: script duration 15ms
subgraph-transition-enter: TBT 138ms
subgraph-transition-enter: heap used 81.9 MB
subgraph-transition-enter: DOM nodes 13673
subgraph-transition-enter: event listeners 2373
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 36ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 3990ms
viewport-pan-sweep: script duration 1010ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 75.5 MB
viewport-pan-sweep: DOM nodes -274
viewport-pan-sweep: event listeners -131
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 15906ms
vue-large-graph-idle: script duration 104ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 172.9 MB
vue-large-graph-idle: DOM nodes -8312
vue-large-graph-idle: event listeners -16391
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 17ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 170
vue-large-graph-pan: task duration 19731ms
vue-large-graph-pan: script duration 398ms
vue-large-graph-pan: TBT 38ms
vue-large-graph-pan: heap used 175.9 MB
vue-large-graph-pan: DOM nodes -8312
vue-large-graph-pan: event listeners -16388
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 17ms
workflow-execution: layout count 2
workflow-execution: style recalc count 8
workflow-execution: task duration 78ms
workflow-execution: script duration 5ms
workflow-execution: TBT 0ms
workflow-execution: heap used 62.4 MB
workflow-execution: DOM nodes 132
workflow-execution: event listeners 38
Raw data
{
  "timestamp": "2026-08-27T15:22:24.168Z",
  "gitSha": "f5615f4bda0637a98d5562d7c16f1a9b4defd27b",
  "branch": "backport-15967-to-cloud-1.52",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2041.9180000000097,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.812,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 494.8859999999999,
      "heapDeltaBytes": 16359700,
      "heapUsedBytes": 78777848,
      "domNodes": -280,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 6.245000000000002,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-idle",
      "durationMs": 2053.6870000000818,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.767999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 478.271,
      "heapDeltaBytes": 18164864,
      "heapUsedBytes": 80668596,
      "domNodes": -281,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 6.379,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1845.2100000000087,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 32.449,
      "layouts": 12,
      "layoutDurationMs": 3.2960000000000003,
      "taskDurationMs": 841.2040000000001,
      "heapDeltaBytes": 6670240,
      "heapUsedBytes": 68374284,
      "domNodes": -284,
      "jsHeapTotalBytes": 6021120,
      "scriptDurationMs": 109.881,
      "eventListeners": -181,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1842.9429999999911,
      "styleRecalcs": 73,
      "styleRecalcDurationMs": 36.269000000000005,
      "layouts": 12,
      "layoutDurationMs": 3.3169999999999997,
      "taskDurationMs": 834.915,
      "heapDeltaBytes": -5202652,
      "heapUsedBytes": 57001296,
      "domNodes": -283,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 107.753,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1671.8650000000252,
      "styleRecalcs": 33,
      "styleRecalcDurationMs": 16.519,
      "layouts": 6,
      "layoutDurationMs": 0.5549999999999999,
      "taskDurationMs": 342.589,
      "heapDeltaBytes": 3653604,
      "heapUsedBytes": 66539748,
      "domNodes": 79,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 8.722000000000003,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1710.4100000000244,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 17.119,
      "layouts": 6,
      "layoutDurationMs": 0.7810000000000001,
      "taskDurationMs": 348.73600000000005,
      "heapDeltaBytes": 3363784,
      "heapUsedBytes": 65865936,
      "domNodes": 77,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 8.673,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 682.3249999999916,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 5.228,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 387.23199999999997,
      "heapDeltaBytes": 11038616,
      "heapUsedBytes": 73200156,
      "domNodes": 12,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 61.358,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 562.4899999999116,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 6.978999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 348.11800000000005,
      "heapDeltaBytes": 10853376,
      "heapUsedBytes": 73756940,
      "domNodes": 18,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 54.667,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2039.8189999999659,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.470999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 595.9929999999999,
      "heapDeltaBytes": -5732380,
      "heapUsedBytes": 71418660,
      "domNodes": -283,
      "jsHeapTotalBytes": -532480,
      "scriptDurationMs": 14.457,
      "eventListeners": -149,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2035.0760000000037,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 5.571000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 586.4830000000001,
      "heapDeltaBytes": -6590724,
      "heapUsedBytes": 70755372,
      "domNodes": -283,
      "jsHeapTotalBytes": -1318912,
      "scriptDurationMs": 13.694999999999995,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2117.8659999999923,
      "styleRecalcs": 68,
      "styleRecalcDurationMs": 12.931999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1174.7259999999999,
      "heapDeltaBytes": -14536204,
      "heapUsedBytes": 63673656,
      "domNodes": -285,
      "jsHeapTotalBytes": 1826816,
      "scriptDurationMs": 330.52500000000003,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2207.4870000000146,
      "styleRecalcs": 70,
      "styleRecalcDurationMs": 15.038000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1184.284,
      "heapDeltaBytes": -13540828,
      "heapUsedBytes": 64626928,
      "domNodes": -282,
      "jsHeapTotalBytes": 2613248,
      "scriptDurationMs": 338.412,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3113.7339999999654,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 15.008000000000001,
      "layouts": 60,
      "layoutDurationMs": 7.07,
      "taskDurationMs": 1307.984,
      "heapDeltaBytes": -9280492,
      "heapUsedBytes": 70302228,
      "domNodes": 14,
      "jsHeapTotalBytes": 6066176,
      "scriptDurationMs": 387.281,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3153.28999999997,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 14.318000000000001,
      "layouts": 60,
      "layoutDurationMs": 7.443,
      "taskDurationMs": 1349.9759999999999,
      "heapDeltaBytes": -14037336,
      "heapUsedBytes": 65315452,
      "domNodes": -288,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 379.065,
      "eventListeners": -153,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2165.555999999981,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 9.672,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1386.4080000000001,
      "heapDeltaBytes": -17184744,
      "heapUsedBytes": 70066076,
      "domNodes": 12,
      "jsHeapTotalBytes": 9211904,
      "scriptDurationMs": 441.695,
      "eventListeners": 186,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2156.558000000018,
      "styleRecalcs": 45,
      "styleRecalcDurationMs": 8.979000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1384.952,
      "heapDeltaBytes": 10579668,
      "heapUsedBytes": 90577860,
      "domNodes": 10,
      "jsHeapTotalBytes": 7532544,
      "scriptDurationMs": 459.252,
      "eventListeners": 186,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2013.091999999972,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.1930000000000005,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 593.74,
      "heapDeltaBytes": -12739740,
      "heapUsedBytes": 65445940,
      "domNodes": -284,
      "jsHeapTotalBytes": 3137536,
      "scriptDurationMs": 15.78,
      "eventListeners": -179,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "minimap-idle",
      "durationMs": 2045.2910000000202,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.307000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 595.031,
      "heapDeltaBytes": -11972492,
      "heapUsedBytes": 71494140,
      "domNodes": -283,
      "jsHeapTotalBytes": 3137536,
      "scriptDurationMs": 14.438000000000002,
      "eventListeners": -179,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 607.6150000000098,
      "styleRecalcs": 48,
      "styleRecalcDurationMs": 12.008,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 391.745,
      "heapDeltaBytes": 11863804,
      "heapUsedBytes": 74592292,
      "domNodes": 22,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 125.02,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 574.5900000000574,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 14.328000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 400.25500000000005,
      "heapDeltaBytes": 11837364,
      "heapUsedBytes": 74753016,
      "domNodes": 20,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 124.716,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2004.7379999999748,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.968999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 488.58200000000005,
      "heapDeltaBytes": 18292276,
      "heapUsedBytes": 80970524,
      "domNodes": -281,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 5.835000000000002,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2022.991999999931,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.921999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 477.264,
      "heapDeltaBytes": -3412928,
      "heapUsedBytes": 59977384,
      "domNodes": -280,
      "jsHeapTotalBytes": 4448256,
      "scriptDurationMs": 5.89,
      "eventListeners": -181,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1709.5460000000458,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 32.89,
      "layouts": 16,
      "layoutDurationMs": 4.034,
      "taskDurationMs": 768.709,
      "heapDeltaBytes": 3539580,
      "heapUsedBytes": 66549868,
      "domNodes": -280,
      "jsHeapTotalBytes": 6021120,
      "scriptDurationMs": 81.63199999999999,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66999999999998,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1708.5409999999683,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 33.084,
      "layouts": 16,
      "layoutDurationMs": 4.253,
      "taskDurationMs": 770.3050000000001,
      "heapDeltaBytes": 17851504,
      "heapUsedBytes": 80755400,
      "domNodes": -280,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 81.922,
      "eventListeners": -151,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1434.7549999999956,
      "styleRecalcs": 19,
      "styleRecalcDurationMs": 31.137999999999998,
      "layouts": 14,
      "layoutDurationMs": 14.331999999999997,
      "taskDurationMs": 925.154,
      "heapDeltaBytes": -6130260,
      "heapUsedBytes": 85914732,
      "domNodes": 13673,
      "jsHeapTotalBytes": 11796480,
      "scriptDurationMs": 15.403,
      "eventListeners": 2373,
      "totalBlockingTimeMs": 138,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8173.694000000012,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 36.913000000000004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3961.983,
      "heapDeltaBytes": 2504428,
      "heapUsedBytes": 79663548,
      "domNodes": -272,
      "jsHeapTotalBytes": -831488,
      "scriptDurationMs": 985.7259999999999,
      "eventListeners": -131,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8147.182000000043,
      "styleRecalcs": 249,
      "styleRecalcDurationMs": 35.367999999999995,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4018.5339999999997,
      "heapDeltaBytes": 1667952,
      "heapUsedBytes": 78690720,
      "domNodes": -276,
      "jsHeapTotalBytes": -307200,
      "scriptDurationMs": 1033.693,
      "eventListeners": -131,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 16724.027999999977,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16001.489999999996,
      "heapDeltaBytes": -51267232,
      "heapUsedBytes": 181205428,
      "domNodes": -8312,
      "jsHeapTotalBytes": -18755584,
      "scriptDurationMs": 103.793,
      "eventListeners": -16389,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 16726.427000000058,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15810.899,
      "heapDeltaBytes": -34639264,
      "heapUsedBytes": 181414908,
      "domNodes": -8312,
      "jsHeapTotalBytes": -13656064,
      "scriptDurationMs": 104.51500000000001,
      "eventListeners": -16393,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20022.087,
      "styleRecalcs": 168,
      "styleRecalcDurationMs": 16.656000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 19639.674999999996,
      "heapDeltaBytes": -25243288,
      "heapUsedBytes": 186965184,
      "domNodes": -8312,
      "jsHeapTotalBytes": -14790656,
      "scriptDurationMs": 396.23500000000007,
      "eventListeners": -16389,
      "totalBlockingTimeMs": 40,
      "frameDurationMs": 17.773333333333238,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20317.387000000053,
      "styleRecalcs": 172,
      "styleRecalcDurationMs": 17.214000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 19821.431999999997,
      "heapDeltaBytes": -49891668,
      "heapUsedBytes": 181945364,
      "domNodes": -8312,
      "jsHeapTotalBytes": -22290432,
      "scriptDurationMs": 400.372,
      "eventListeners": -16387,
      "totalBlockingTimeMs": 36,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 120.60599999995247,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 16.727,
      "layouts": 2,
      "layoutDurationMs": 1.1849999999999998,
      "taskDurationMs": 81.26400000000001,
      "heapDeltaBytes": 3252044,
      "heapUsedBytes": 65442764,
      "domNodes": 137,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 6.065000000000001,
      "eventListeners": 49,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 107.7020000000175,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 17.465999999999998,
      "layouts": 2,
      "layoutDurationMs": 1.027,
      "taskDurationMs": 75.63300000000001,
      "heapDeltaBytes": 2947704,
      "heapUsedBytes": 65359128,
      "domNodes": 127,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 4.772000000000002,
      "eventListeners": 27,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

@github-actions
github-actions Bot requested a review from thedatalife August 27, 2026 04:19
@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.52   #16091   +/-   ##
=============================================
  Coverage              ?   81.99%           
=============================================
  Files                 ?     1910           
  Lines                 ?   109941           
  Branches              ?    31189           
=============================================
  Hits                  ?    90146           
  Misses                ?    19452           
  Partials              ?      343           
Flag Coverage Δ
e2e 66.14% <100.00%> (?)
unit 73.99% <100.00%> (?)

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

Files with missing lines Coverage Δ
...rkspace/components/CurrentUserPopoverWorkspace.vue 91.39% <100.00%> (ø)
...e/components/SubscriptionPanelContentWorkspace.vue 97.20% <100.00%> (ø)
...omponents/dialogs/settings/BillingStatusBanner.vue 97.01% <100.00%> (ø)
...c/platform/workspace/composables/useWorkspaceUI.ts 98.46% <100.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.

@dante01yoon dante01yoon added the backport Backporting a PR onto a release candidate label Aug 27, 2026
@dante01yoon
dante01yoon force-pushed the backport-15675-to-cloud-1.52 branch from 690adfb to 61e68e6 Compare August 27, 2026 14:50
Base automatically changed from backport-15675-to-cloud-1.52 to cloud/1.52 August 27, 2026 15:07
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 27, 2026
…he policy (#15967)

### The bug

The cancelled-plan **Resubscribe** action was gated on the
server-resolved `can_reactivate`. `legacy_stripe` workspaces have no
capability projection row, so it resolves `false` for them and the
button disappears for customers who should have it.

`CurrentUserPopoverWorkspace` was the third and last site with this
problem — the follow-up promised on the #15675 review thread, which
deliberately left this file out of scope.

### The refactor (added in review)

Fixing the third site would have made a third verbatim copy of the same
expression, so per review feedback the policy is now centralized instead
of duplicated in views.

`useWorkspaceUI` — which already owns `permissions` — exposes one
derived value:

```ts
// legacy_stripe workspaces have no capability projection row, so the
// server-resolved can_reactivate is false for them and cannot gate the
// action; that rail stays on the membership check.
const canReactivatePlan = computed(() =>
  isCloud && shouldUseWorkspaceBilling.value
    ? canReactivate.value
    : permissions.value.canManageSubscriptionLifecycle
)
```

`SubscriptionPanelContentWorkspace`, `BillingStatusBanner` and
`CurrentUserPopoverWorkspace` all consume it; their local copies and
now-unused `useBillingRouting` / `isCloud` imports are gone. So the
third site is fixed **and** the pre-existing duplication is removed.

No import cycle — neither `useBillingRouting` nor
`useBillingCapabilities` imports `useWorkspaceUI`.

### Deliberately not folded in

`useWorkspaceMenuItems` has a similar-looking expression for **cancel**,
but it carries an extra free-tier guard (`can_cancel` stays true for an
active FREE plan). Same shape, different policy — left alone.

### Verification

- Policy tests live in `useWorkspaceUI.test.ts` now, where the policy
does: consolidated rail (uses the capability), legacy rail, and
off-Cloud (both fall back to membership). Verified they actually bite by
stubbing the policy out — **2 failed**.
- The off-Cloud case is new: `isCloud` is `false` by default under
vitest and the composable test wasn't mocking it, so that branch had
never been exercised.
- Component tests keep their behavioural cases and drive the shared
value.
- On this head: `pnpm typecheck` clean; **127 passing** across the four
affected files; full suite `1317/1318` files green — the only failures
are 12 pre-existing `check-binary-size` cases that fail independently of
this change.

(cherry picked from commit 0c89141)
@dante01yoon
dante01yoon force-pushed the backport-15967-to-cloud-1.52 branch from abc766d to 2586e76 Compare August 27, 2026 15:09
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Aug 27, 2026
@dante01yoon
dante01yoon enabled auto-merge (squash) August 27, 2026 15:14
@dante01yoon
dante01yoon merged commit 8dc2d02 into cloud/1.52 Aug 27, 2026
88 checks passed
@dante01yoon
dante01yoon deleted the backport-15967-to-cloud-1.52 branch August 27, 2026 15:24
@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
another-chi pushed a commit to another-chi/ComfyUI_frontend that referenced this pull request Sep 4, 2026
…nt-derived one (Comfy-Org#16967)

## Summary

The pricing table decided *which* server capability governs each plan
card from client-side state, then read it with a `?? false` default — so
a workspace the server was permitting to subscribe rendered every card
disabled. This gates on the server capability set directly. Labels are
unchanged.

## Root cause

`GET /v1/billing/capabilities` answers a **workspace-scoped** question —
seven booleans, with `resolved_for` carrying only `{user_id,
workspace_id}`. The pricing table needs a **card-scoped** answer: "can
this workspace move to Creator-Yearly right now?" Nothing in the
response can produce that, so the component synthesized it.

`canUsePersonalPlanAction` picked the governing capability from
`hasActivePaidPlan(tier)`, `isCurrentPlan()`, `isCancelled` and
`isEnded`; `isTeamButtonDisabled` did the same job with a different
expression off `isTeamSubscribed`. That selection is policy, and it
fails in two ways:

**1. The client picks the wrong capability.** A legacy-rail workspace
holds a paid tier with no local subscription row. `hasActivePaidPlan` is
therefore true, so the table reads `can_change_seats` — false, because
`ResolveBillingCapabilities`'s `!HasSubscription` branch clears it — and
greys the card. That same branch leaves `can_subscribe_self_serve`
**true**, which is what the server actually returns for these
workspaces. The field that is true is never consulted.

**2. "Not yet known" renders as "denied."** `useBillingCapabilities`
models five read states (`idle | pending | denied | unavailable |
resolved`), collapses them to `null`, and
`canSubscribeSelfServe`/`canChangeSeats` collapse that to `false`. A
slow or failed read disables every plan button for anyone, including new
signups. `canTopUp` three lines above deliberately falls open for
owners, and `canOpenPricingSurface` falls open to membership — so we let
people into a modal whose every button is dead by design.

The capability set is documented as *"Effective billing UI
**guidance**"*, not an authorization boundary; every checkout endpoint
resolves policy again on the write. Treating guidance as a hard gate is
what turns a server "probably not" into a customer who cannot buy.

Both symptoms are invisible in monitoring: a disabled button emits
nothing, and the endpoint returns HTTP 200 with the capability false.
That is how 560 workspaces accumulated from 2026-02-10 without paging
anyone.

```
                       BEFORE                                    AFTER
  ┌───────────────────────────────────────┐    ┌───────────────────────────────────────┐
  │ card ──> hasActivePaidPlan? ──┬─ yes ─→│    │ card ──> offersTransition?  (shape)   │
  │                               │        │    │            │                          │
  │                               │  can_change_seats        └──> lifecycleActionPermitted
  │                               └─ no ──→│    │                 = subscribe            │
  │                        can_subscribe_self_serve             ‖ change_seats           │
  │                                        │    │                 ‖ reactivate           │
  │  null/pending/failed ──> ?? false      │    │  unresolved ──> true (server decides)  │
  └───────────────────────────────────────┘    └───────────────────────────────────────┘
```

## Why this is better, not just different

Three properties hold after this change that did not hold before.

**The client can no longer invent a denial the server never made.** Two
separate client decisions could each produce a dead button on their own:
choosing which capability applies, and defaulting an absent answer to
`false`. Both are gone. A CTA now goes dead on permission grounds only
when a resolved server response permits no lifecycle write.

**The failure mode moves from silent lockout to loud rejection.** A
wrongly disabled button emits nothing — no error, no telemetry, no page
— which is exactly how this went unnoticed for seven months. A wrongly
enabled button produces a failed checkout call that is visible in
Datadog and answered by the server. Since the capability set is
explicitly guidance and the write re-checks policy, trading the first
failure mode for the second is the right direction for a billing
surface.

**Divergence has one place to go wrong instead of two.** Personal and
team carried two hand-written gate expressions over the same
capabilities, already disagreeing on how each classified "current plan".
They now derive from one base — the personal catalog is that base plus
the single write only it can receive — so a capability change cannot fix
one surface and silently miss the other.

## Changes

- **What**: Per-card capability selection is replaced by one gate per
catalog, neither of which reads client subscription state.
`lifecycleActionPermitted` (team catalog) asks whether the server
permits any write that can reach it: `can_subscribe_self_serve ||
can_change_seats || can_reactivate`. `personalPlanActionPermitted`
(personal catalog) adds `can_downgrade_to_personal`, the one further
write that reaches a personal card. Which capabilities belong to a
catalog is a static property of the surface, not a judgement about the
customer. An unresolved snapshot (`!snapshotAuthoritative`) keeps the
CTA live and lets the checkout endpoint enforce — the same trade
`canOpenPricingSurface` and `canTopUp` already make. Non-Cloud still
routes to workspace permissions.
- **What**: `canDowngradeToPersonal` gains the same unresolved-snapshot
fallback. It also gates the plan-scope toggle, so under `?? false` a
team-plan workspace lost every personal card *and the personal tab with
it* before the server had answered — a whole catalog removed silently,
not a greyed button.
- **What**: `offersTransition` keeps the one genuinely client-side check
— an active current plan has no transition to offer. See Review Focus
for why no server field replaces it today.
- **What**: Fixes the team CTA treating an ended subscription's
still-reported credit stop as the current plan.
`isTeamCurrentPlanSelected` was previously shadowed by the
`!isTeamSubscribed` early return; composing the two flat conditions
exposed it.
- **Breaking**: none.

Cohort outcomes, in the terms of INC-128:

| | server returns | before | after |
|---|---|---|---|
| legacy rail (9,868) | `subscribe: true`, `change_seats: false` |
disabled | **enabled** |
| stranded checkout row (560) | all lifecycle capabilities false |
disabled | disabled |
| unresolved / failed read | no answer | disabled | **enabled**, server
enforces |
| team plan, unresolved read | no answer | personal tab **removed** |
tab kept, CTAs live |
| team plan, downgrade permitted only | `downgrade: true`, rest false |
personal cards disabled | **enabled** (team CTA stays disabled) |

It does not flip a single resolved denial into an allow.

## Review Focus

**This must not merge before Comfy-Org#8399 is deployed.** Cause 1 of INC-128 is
"a declined checkout leaves a `scheduled` row that wedges the customer."
Failing open means more attempted checkouts, and any that decline before
Comfy-Org#8399 lands create new stranded rows on the path already producing
6–15/day.

**Open question, for whoever owns the checkout path (Wei Hai).** If a
workspace with `can_subscribe_self_serve: false` calls the
checkout-create endpoint directly, does the server reject it, or is the
capability the only gate? `useWorkspaceUI.ts:209` asserts *"every
checkout endpoint enforces its own policy"* and `canOpenPricingSurface`
already relies on it, but I have not verified it in `cloud` and would
rather not ship on the comment alone.

**One gate is deliberately loosened.** Resubscribe was gated on
`canReactivatePlan` (the derived value with the legacy-rail membership
fallback from Comfy-Org#16091); it is now gated on the union. A cancelled
subscriber with `can_reactivate: false` but `can_subscribe_self_serve:
true` can now click it. That is intentional under "the write is the
authorization boundary", and it is the change that depends most on the
answer above. `disables Resubscribe when the server permits no lifecycle
write` covers the closed direction.

**Why `offersTransition` stays client-side.** `GET /api/billing/plans`
already returns `availability: {available, reason}` per plan, and
`reason: same_plan` looks like a drop-in replacement. It is not.
`currentPlanSlug` there comes from `GetBillingStatus().PlanSlug`, which
is populated for `ended` and `canceled` subscriptions too, so the server
marks both **unavailable**. Adopting it would stop an ended plan being
buyable again and would disable Resubscribe — two new instances of the
exact failure this PR removes. The client already corrects for both
(`isCurrentPlan` returns false when `isEnded`; `offersTransition` allows
a cancelled current plan). Making `same_plan` subscription-status-aware
is the server-side prerequisite, and it belongs next to
`Comfy-Org/cloud#6275`, which is already about making `available` agree
with the write path.

An earlier revision of this description claimed a stranded `scheduled`
row could reach `isCurrentPlan` via `/api/billing/status`. That was
wrong and is removed: `GetBillingStatus` reads only
`ws.ActiveSubscriptionID` and then explicitly skips `scheduled`
(`common/repository/billing/workspace.go`), so the 560 cohort's leftover
row cannot surface as a plan slug. The asymmetry with
`GetCapabilitySubscription`, which deliberately *does* fall back to a
scheduled row, is what makes Cause 1 a capability-side problem only.

**Explicitly out of scope.** Labels and the subscribe/resubscribe emit
still derive from `isCurrentPlan` / `hasActivePaidPlan`. A wrong label
is cosmetic and the server revalidates the action; a wrong gate locks
someone out. Deciding labels from capabilities is tracked as
[FE-2038](https://linear.app/comfyorg/issue/FE-2038/decide-pricing-button-labels-through-capabilities-api),
pending Alex's read on whether the current fields cover every UX string.
`availability`'s other reasons (`exceeds_max_seats`, and
`annual_to_monthly_unsupported` from `cloud#6275`) are additive rather
than corrective — they close false positives, not the false negatives
this PR is about — so they are deferred too.

`Comfy-Org/cloud#8417` adds `denied_reasons`, which is what would let a
disabled CTA say *why*. That is the missing half: this stops the wrong
buttons being disabled, but a legitimately disabled one still carries no
explanation.

## Tests

`pnpm vitest run src/platform/workspace src/platform/cloud/subscription
src/composables/billing` — 99 files, 1854 tests, 1852 passing. The two
failures are in `useFreeTierQuota.test.ts`, which fails identically on
`origin/main` and shares no imports with the changed files. `pnpm
typecheck`, `pnpm lint` (0 errors), `pnpm knip` clean.

Seven regression tests added in `UnifiedPricingTable.test.ts` — one per
row of the cohort table, plus the invariants worth pinning:

- `keeps a paid plan actionable when only change-seats is withheld` —
the legacy-rail case
- `keeps the CTA live while the capability snapshot is unresolved`
- `keeps personal plans reachable on a team plan while the snapshot is
unresolved`
- `blocks the CTA when a resolved snapshot permits no lifecycle write` —
proves this is not a blanket fail-open
- `withholds personal plans when a resolved snapshot denies the
downgrade` — the resolved-denial counterpart
- `does not let the downgrade capability alone enable the team CTA`
- `keeps personal cards actionable when only the downgrade is permitted`
— the same capability on the surface it does govern
- `keeps the team CTA live while the capability snapshot is unresolved`
— the same row, on the other surface

The last two guard a cross-repo invariant rather than a reachable bug:
`ResolveBillingCapabilities` sets `CanDowngradeToPersonal =
IsOriginalOwner && CanSubscribeSelfServe`, and every branch that clears
subscribe clears downgrade first, so a true downgrade currently implies
a true subscribe. Both directions of the catalog split are pinned so
neither silently depends on that holding.

`browser_tests/tests/dialogs/pricingTableCapabilityGating.spec.ts`
(`@cloud`) drives the real dialog against capability responses shaped
like the cohorts, which the unit tests cannot do — they render the table
directly, so they prove the expression but not that a customer reaches a
live button. **Verified red on the pre-change component**: the
legacy-rail, unresolved-read and failed-read cases all fail there.

The closed direction is deliberately unit-only, and the spec says why.
Every entry point to the catalog — the `?pricing=` deep link, the
settings panel link, the user popover — is itself gated on
`canOpenPricingSurface`, which resolves to `can_subscribe_self_serve`. A
resolved refusal therefore *withholds the dialog* rather than opening it
with dead cards; the e2e asserts that as the negative control. It also
means the dialog-with-every-button-dead state this incident reported is
only reachable through an unresolved read, which is the route this PR
fixes.

An earlier revision of this section claimed e2e was impossible because
`browser_tests` could not construct the account shapes. That was wrong:
`setupCloudApp` takes the capability response directly, including a
never-resolving promise for the pending case.

## Screenshots

AS IS / TO BE captures from the real app to follow in a comment —
capture takes a while and I did not want to hold the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:xhigh PR risk grade (advisory shadow check; grader-owned) size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants