Repository navigation
fix(billing): don't show the subscribe paywall before billing status resolves - #14965
Conversation
…resolves canRunWorkflows is false from the first render: isInitialized starts false, subscription is null, and canAccessSubscriptionFeatures reads statusData?.is_active ?? false. Neither the cloud run button nor the linear controls read isInitialized, so the locked Subscribe to run button was the default render, asserted on no data at all. A paying subscriber whose status fetch is slow, failing, or scoped to the wrong workspace therefore saw a paywall over the Run button with no recovery path, which is FE-1540 and the six Pylon tickets behind it. showsSubscribeToRunPrompt only claims the user needs to subscribe once billing status has actually resolved. Entitlement is still enforced by the backend on execution, so failing open for the unresolved window is the safer direction.
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1793 passed, 0 failed · 4 flaky📊 Browser Reports
📦 Bundle: 8.69 MB gzip 🔴 +13 BDetailsSummary
Category Glance App Entry Points — 3.67 kB (baseline 3.67 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.36 MB (baseline 1.36 MB) • 🔴 +45 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 570 kB (baseline 570 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 16 unchanged User & Accounts — 27 kB (baseline 27 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 4 unchanged Editors & Dialogs — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 67.1 kB (baseline 67.1 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 8 unchanged Data & Services — 3.5 MB (baseline 3.5 MB) • 🔴 +127 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 550 kB (baseline 550 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 20 unchanged Vendor & Third-Party — 16.3 MB (baseline 16.3 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 17 unchanged Other — 14 MB (baseline 14 MB) • 🔴 +21 BBundles that do not match a named category
Status: 68 added / 68 removed / 218 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-09T05:10:22.608Z",
"gitSha": "9018591b8b4f698958c0b5fff8a6be65a334eb02",
"branch": "fix/run-gate-no-paywall-before-init",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2005.6140000000084,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.312999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.312,
"heapDeltaBytes": 5842488,
"heapUsedBytes": 70300220,
"domNodes": 18,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 16.903000000000002,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2032.8309999999874,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.624,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 486.5330000000001,
"heapDeltaBytes": 5846204,
"heapUsedBytes": 70362576,
"domNodes": 16,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 18.739,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2052.328999999986,
"styleRecalcs": 80,
"styleRecalcDurationMs": 48.522,
"layouts": 12,
"layoutDurationMs": 3.967,
"taskDurationMs": 1065.1589999999999,
"heapDeltaBytes": -10517732,
"heapUsedBytes": 53802244,
"domNodes": -281,
"jsHeapTotalBytes": 25403392,
"scriptDurationMs": 137.65099999999998,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1806.096000000025,
"styleRecalcs": 76,
"styleRecalcDurationMs": 38.385000000000005,
"layouts": 12,
"layoutDurationMs": 3.459,
"taskDurationMs": 853.918,
"heapDeltaBytes": 108132,
"heapUsedBytes": 64218756,
"domNodes": 58,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 125.34799999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1737.33900000002,
"styleRecalcs": 31,
"styleRecalcDurationMs": 16.993,
"layouts": 6,
"layoutDurationMs": 0.5969999999999999,
"taskDurationMs": 399.437,
"heapDeltaBytes": 8754384,
"heapUsedBytes": 73163668,
"domNodes": 78,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 21.693,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1755.2760000000944,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.768,
"layouts": 6,
"layoutDurationMs": 0.7509999999999999,
"taskDurationMs": 401.88899999999995,
"heapDeltaBytes": 8564204,
"heapUsedBytes": 72996576,
"domNodes": 77,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 21.277,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 557.2839999999815,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.586,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 378.893,
"heapDeltaBytes": -11200184,
"heapUsedBytes": 53126416,
"domNodes": 18,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 59.795,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 611.0459999999875,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.342000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 413.91599999999994,
"heapDeltaBytes": -11247948,
"heapUsedBytes": 53235348,
"domNodes": 18,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 63.181000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2034.7239999999829,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.350999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 710.6360000000001,
"heapDeltaBytes": 6769316,
"heapUsedBytes": 66894072,
"domNodes": -283,
"jsHeapTotalBytes": 2985984,
"scriptDurationMs": 112.901,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2040.3370000000223,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.738,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 701.1139999999999,
"heapDeltaBytes": 5104956,
"heapUsedBytes": 64533192,
"domNodes": -281,
"jsHeapTotalBytes": 3510272,
"scriptDurationMs": 113.928,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2218.034999999986,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.131000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1319.746,
"heapDeltaBytes": 5223224,
"heapUsedBytes": 65682496,
"domNodes": -284,
"jsHeapTotalBytes": 3964928,
"scriptDurationMs": 445.20300000000003,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2216.393000000039,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.204999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1323.0720000000001,
"heapDeltaBytes": -4891340,
"heapUsedBytes": 55692108,
"domNodes": -283,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 441.147,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3364.0960000000177,
"styleRecalcs": 65,
"styleRecalcDurationMs": 16.962,
"layouts": 60,
"layoutDurationMs": 8.214,
"taskDurationMs": 1593.121,
"heapDeltaBytes": 26546412,
"heapUsedBytes": 88879472,
"domNodes": 12,
"jsHeapTotalBytes": 7602176,
"scriptDurationMs": 575.886,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3230.780999999979,
"styleRecalcs": 64,
"styleRecalcDurationMs": 14.988000000000001,
"layouts": 60,
"layoutDurationMs": 7.856,
"taskDurationMs": 1570.4340000000002,
"heapDeltaBytes": -2004696,
"heapUsedBytes": 60124932,
"domNodes": -289,
"jsHeapTotalBytes": 6393856,
"scriptDurationMs": 546.072,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2037.982999999997,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.142,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 720.4270000000001,
"heapDeltaBytes": 6507376,
"heapUsedBytes": 67062652,
"domNodes": -283,
"jsHeapTotalBytes": 2985984,
"scriptDurationMs": 116.411,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2032.7949999999646,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.148999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 744.7719999999999,
"heapDeltaBytes": 6595012,
"heapUsedBytes": 67211736,
"domNodes": -286,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 120.01,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 643.4259999999767,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.940000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 442.40000000000003,
"heapDeltaBytes": -10591524,
"heapUsedBytes": 53820784,
"domNodes": 22,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 137.649,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 625.925000000052,
"styleRecalcs": 48,
"styleRecalcDurationMs": 12.369000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 423.78499999999997,
"heapDeltaBytes": -10375496,
"heapUsedBytes": 54055696,
"domNodes": 22,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 124.07199999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1999.674999999968,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.207,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 476.27299999999997,
"heapDeltaBytes": 5652996,
"heapUsedBytes": 70080664,
"domNodes": 18,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 15.516,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2011.4229999999225,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.932,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.756,
"heapDeltaBytes": 5633536,
"heapUsedBytes": 70132528,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 15.783000000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1731.5940000000296,
"styleRecalcs": 78,
"styleRecalcDurationMs": 44.308,
"layouts": 16,
"layoutDurationMs": 4.931,
"taskDurationMs": 863.88,
"heapDeltaBytes": -3340640,
"heapUsedBytes": 60998684,
"domNodes": 64,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 103.747,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1706.4649999999801,
"styleRecalcs": 76,
"styleRecalcDurationMs": 39.119,
"layouts": 16,
"layoutDurationMs": 4.622,
"taskDurationMs": 823.288,
"heapDeltaBytes": -3821604,
"heapUsedBytes": 60754808,
"domNodes": 62,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 99.217,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1417.8489999999897,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.514,
"layouts": 15,
"layoutDurationMs": 13.084000000000001,
"taskDurationMs": 960.3170000000001,
"heapDeltaBytes": 5131136,
"heapUsedBytes": 89279820,
"domNodes": 13673,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 38.94099999999999,
"eventListeners": 2375,
"totalBlockingTimeMs": 143,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8396.049000000005,
"styleRecalcs": 250,
"styleRecalcDurationMs": 38.80200000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4642.965999999999,
"heapDeltaBytes": 14780072,
"heapUsedBytes": 74161120,
"domNodes": -280,
"jsHeapTotalBytes": 6062080,
"scriptDurationMs": 1424.075,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8487.308999999983,
"styleRecalcs": 250,
"styleRecalcDurationMs": 39.169999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4743.127,
"heapDeltaBytes": 14559692,
"heapUsedBytes": 74053180,
"domNodes": -283,
"jsHeapTotalBytes": 5275648,
"scriptDurationMs": 1468.179,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17471.439999999973,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17444.474,
"heapDeltaBytes": -35145776,
"heapUsedBytes": 169770564,
"domNodes": -8345,
"jsHeapTotalBytes": -12259328,
"scriptDurationMs": 584.688,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.773333333333238,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 17425.709000000097,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17398.707,
"heapDeltaBytes": -51575204,
"heapUsedBytes": 176855980,
"domNodes": -8312,
"jsHeapTotalBytes": -9641984,
"scriptDurationMs": 593.669,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21277.106000000003,
"styleRecalcs": 145,
"styleRecalcDurationMs": 17.62600000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21214.323,
"heapDeltaBytes": -51902112,
"heapUsedBytes": 154111840,
"domNodes": -8312,
"jsHeapTotalBytes": -12521472,
"scriptDurationMs": 898.3679999999999,
"eventListeners": -16383,
"totalBlockingTimeMs": 182,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 20792.67200000004,
"styleRecalcs": 139,
"styleRecalcDurationMs": 16.88899999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20750.184,
"heapDeltaBytes": -51502892,
"heapUsedBytes": 153964464,
"domNodes": -8316,
"jsHeapTotalBytes": -11214848,
"scriptDurationMs": 893.746,
"eventListeners": -16385,
"totalBlockingTimeMs": 182,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 456.9890000000214,
"styleRecalcs": 14,
"styleRecalcDurationMs": 19.746999999999996,
"layouts": 3,
"layoutDurationMs": 0.6529999999999999,
"taskDurationMs": 113.71000000000002,
"heapDeltaBytes": 5130584,
"heapUsedBytes": 68575144,
"domNodes": 126,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 10.361999999999998,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 469.6910000000116,
"styleRecalcs": 12,
"styleRecalcDurationMs": 20.179,
"layouts": 3,
"layoutDurationMs": 0.6489999999999998,
"taskDurationMs": 112.62400000000001,
"heapDeltaBytes": 5046956,
"heapUsedBytes": 68474188,
"domNodes": 121,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 9.764999999999999,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
📝 WalkthroughWalkthroughThe billing context now exposes initialization-aware subscription-prompt state. Cloud run and linear controls use this state instead of direct workflow eligibility checks. Tests cover queue-button visibility while billing initialization is incomplete. ChangesBilling prompt flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant useBillingContext
participant CloudRunButtonWrapper
participant LinearControls
useBillingContext->>CloudRunButtonWrapper: showsSubscribeToRunPrompt
useBillingContext->>LinearControls: showsSubscribeToRunPrompt
CloudRunButtonWrapper->>CloudRunButtonWrapper: render queue or subscribe control
LinearControls->>LinearControls: render mobile or desktop prompt
Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/actionbar/ComfyRunButton/CloudRunButtonWrapper.test.ts`:
- Around line 121-124: Replace the test-id assertions in the relevant test with
accessible button queries, using each control’s stable visible label or
accessible name. Preserve the existing expectations that the queue button is
present and the subscribe-to-run button is absent.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2179373f-261d-4976-95d2-460e162f8b65
📒 Files selected for processing (6)
src/components/actionbar/ComfyRunButton/CloudRunButtonWrapper.test.tssrc/components/actionbar/ComfyRunButton/CloudRunButtonWrapper.vuesrc/composables/billing/types.tssrc/composables/billing/useBillingContext.tssrc/renderer/extensions/linearMode/LinearControls.vuesrc/storybook/mocks/useBillingContext.ts
| expect(screen.getByTestId('queue-button')).toBeInTheDocument() | ||
| expect( | ||
| screen.queryByTestId('subscribe-to-run-button') | ||
| ).not.toBeInTheDocument() |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Prefer accessible queries for these controls.
getByTestId and queryByTestId couple the test to implementation-specific hooks. Use accessible button queries or visible labels when stable names are available.
Based on learnings, prefer accessible properties over data-testid selectors in component tests.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/actionbar/ComfyRunButton/CloudRunButtonWrapper.test.ts` around
lines 121 - 124, Replace the test-id assertions in the relevant test with
accessible button queries, using each control’s stable visible label or
accessible name. Preserve the existing expectations that the queue button is
present and the subscribe-to-run button is absent.
Source: Learnings
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #14965 +/- ##
==========================================
- Coverage 81.25% 81.25% -0.01%
==========================================
Files 1871 1871
Lines 106471 106476 +5
Branches 31360 31830 +470
==========================================
+ Hits 86512 86513 +1
+ Misses 19612 19604 -8
- Partials 347 359 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
dante01yoon
left a comment
There was a problem hiding this comment.
The shared initialization-aware prompt gate fixes the premature paywall without changing post-initialization entitlement behavior. FREE-tier execution remains governed by canRunWorkflows; the Storybook mock limitation is non-blocking.
…mfy-Org#15207) ## Why FE-1540 is only partially fixed by Comfy-Org#14965. The Run surface no longer shows a paywall before billing initializes, but a successful `inactive` response remains cached when the authoritative subscription changes outside the open app—for example after returning from Stripe Portal, another tab, a delayed webhook, or a support action. `CloudRunButtonWrapper` previously refreshed on focus only when its own paused-payment recovery flow set `refreshBillingOnFocus`. A plain `Subscribe to Run` state had no focus/visibility recovery, so the user needed a manual page reload even after the server became `active`. ## AS IS ```mermaid sequenceDiagram participant FE as Open editor participant API as Billing API participant Provider as Stripe / webhook FE->>API: Fetch billing status API-->>FE: inactive Note over FE: Show Subscribe to Run Provider->>API: Subscription becomes active Note over FE,API: No pending BillingOp and no general refetch Note over FE: Cached inactive state remains until reload ``` ## TO BE ```mermaid sequenceDiagram participant User participant FE as CloudRunButtonWrapper participant Context as useBillingContext participant API as Authoritative billing API User->>FE: Return to app (focus / visible) FE->>FE: Confirm Subscribe to Run is displayed FE->>Context: fetchStatus + fetchBalance alt legacy billing rail Context->>API: Legacy billing reads else workspace billing rail Context->>API: Workspace billing reads end API-->>Context: active + current balance Context-->>FE: Reactive billing state updates Note over FE: Subscribe to Run becomes Run ``` ## Change - Revalidate status and balance when an app showing `Subscribe to Run` regains focus or becomes visible. - Route through `useBillingContext`, so the active legacy or workspace billing adapter remains authoritative. - Deduplicate overlapping `focus` and `visibilitychange` refreshes. - Preserve the existing paused-payment portal recovery behavior. - Do not add continuous polling: known new-billing checkouts retain BillingOp polling, while this is a bounded recovery trigger for changes outside that flow. ## Scope This PR does **not** infer subscription state in the frontend and does not attempt to prevent or resolve duplicate Stripe subscriptions. Provider subscription integrity remains a backend responsibility; the frontend only re-reads the server-authored state. ## Testing - `pnpm test:unit src/components/actionbar/ComfyRunButton/CloudRunButtonWrapper.test.ts` — 15 passed - `pnpm typecheck` — passed - changed-file ESLint, type-aware oxlint, and formatting checks — passed - `pnpm knip` — blocked by two existing unused devDependencies on `main` (`@storybook/addon-mcp`, `lint-staged`); this PR does not change package or knip configuration The component regression covers the observable AS IS → TO BE transition: stale `inactive`/Subscribe state, app focus, authoritative refresh, and restored Run button. No visual styling changes. Linear: FE-1540 --------- Co-authored-by: Amp <amp@ampcode.com>
Summary
Part of FE-1540 / PAY-004. Six Pylon tickets (#16322, #16286, #16285, #16284, #16280, #16274), one customer threatening a formal payment dispute.
canRunWorkflowsisfalsefrom the very first render —isInitializedstartsfalse,subscriptionisnull, andcanAccessSubscriptionFeaturesisstatusData.value?.is_active ?? false(useWorkspaceBilling.ts:127-129). NeitherCloudRunButtonWrapper.vuenorLinearControls.vuereadisInitialized,isLoading, orerror, so the locked "Subscribe to run" button was the default render, asserted on no data at all.A paying subscriber whose status fetch is slow, failing, or scoped to the wrong workspace saw a paywall over Run, with no recovery path —
CloudRunButtonWrapper's focus refetch is gated behindrefreshBillingOnFocus, which is only set inside the payment-recovery dialog, so it never fires for a plain status desync.Worth stating because it contradicts an assumption made during triage:
canAccessSubscriptionFeaturesdoes not mean "this user has a paid subscription", it means "the last status response saidis_active: true". Those differ during a desync, which is the incident.Change
Adds
showsSubscribeToRunPromptto the billing context — it only claims the user needs to subscribe once billing status has resolved:Consumed at the three render sites (
CloudRunButtonWrapper.vue:3,LinearControls.vue:182,246) instead of each re-deriving the rule.During the unresolved window the normal Run button renders. Entitlement is still enforced by the backend on execution, and
useAccountPreconditionDialogalready handles that rejection, so failing open for that window is the safer direction — a subscriber who cannot run is a dispute, a non-subscriber who clicks Run gets a clear server-driven prompt.Scope
Deliberately the low-risk half of FE-1540. Not included, because they change Run-button behaviour for all cloud users and want a human call during an active incident:
useWorkspaceBilling.ts:244so a successful-but-stale response cannot silently downgrade a previously-active subscriptionAlso not addressed here:
getBillingStatus()sends no workspace parameter (workspaceApi.ts:430-441), so a subscription on a team workspace while Personal is active reads the wrong billing entirely. Tracked on FE-1540.Tests
New case
keeps the run button while billing status is still resolving, verified red against the old gate:275 tests pass across the 19 affected suites.
pnpm typecheckexit 0,pnpm knipexit 0.