Repository navigation
[backport core/1.51] feat(workspace): enable local credit workspace switching FE-1584 - #15558
Conversation
) ## Why Local/Desktop users cannot select the workspace that owns their subscription or credits. The existing workspace and billing clients also resolve through `api.apiURL()`, which points at the local ComfyUI server off Cloud, so simply exposing the Cloud switcher leaves workspace hydration dormant and returns 404s. ## Root cause The Cloud-only UI guard hid the switcher, but the deeper boundary was also Cloud-only: - workspace token exchange, workspace listing, and `/billing/*` used same-origin URLs - generic auth helpers mixed Firebase user identity with workspace-scoped identity - Cloud workspace switching reloads the app and changes workflow-persistence namespaces, which is incorrect for Local/Desktop where workspaces are credit wallets only ## Change - Expose the existing workspace switcher in Local/Desktop after Firebase auth hydrates; keep workspace creation Cloud-only. - Route workspace auth, listing, and billing requests to the build's Firebase-paired Cloud gateway (`cloud.comfy.org` in production, `testcloud.comfy.org` in non-production) while Cloud remains same-origin. - Separate Firebase-authenticated `/customers/*` calls from workspace-authenticated billing and partner-node execution. - Switch the active local credit context without reloading or moving local workflow persistence; persist the selected wallet per device. - Keep Add credits permission-aware and return completed/pending top-ups to Settings → Credits on Local/Desktop. ### Implementation scope and rationale | Area | Change | Why it is required | | --- | --- | --- | | Workspace API routing | Resolve workspace and billing requests through the Firebase-paired Cloud gateway outside the Cloud distribution. | Local `/api` targets the local ComfyUI server, while workspace and billing state is owned by Cloud ingest. | | Authentication boundary | Separate Firebase user authentication from workspace-scoped authentication, including partner-node queue execution. | A Firebase token identifies the user; the workspace token deterministically identifies the wallet that owns credits and receives usage charges. | | Workspace bootstrap | Share and await the in-flight Local workspace initialization, and fail closed when no active workspace can be established. | Prompt submission during bootstrap must not run without credentials or silently fall back to the personal workspace. | | Local switch lifecycle | Switch the active credit workspace without reloading the document. | Cloud reload semantics are unnecessary for Local and would interrupt the current local workflow. | | Workflow persistence | Keep Local workflow storage in the personal namespace when the credit workspace changes. | Local workspace selection changes the billing wallet only; it must not move, clear, or split locally stored workflows. | | Billing routing | Use workspace billing after Local workspace hydration. | Balances, plans, billing events, and top-ups must follow the selected credit workspace rather than the personal account. | | Billing permissions | Keep Credits visible while hiding Add credits for members who cannot top up. | Backend top-up operations are owner-only, so the UI must not offer an action the selected workspace role cannot perform. | | Top-up completion | Return completed or pending Local top-ups to Settings → Credits. | Local does not expose the Cloud workspace-management destination used by the existing Cloud flow. | | Cloud customer endpoints | Explicitly retain Firebase authentication for user-scoped customer and subscription calls. | Changing generic auth precedence must not send a workspace token to endpoints whose contract is user-scoped. | | Feature-flag isolation | Disable `unified_cloud_auth` outside the Cloud distribution. | Unified Cloud JWT minting is not available in Local/Desktop; accepting that flag there would break workspace discovery and execution authentication. | | Regression coverage | Add focused unit tests and a Local Playwright workspace-switching flow. | The tests protect workspace attribution, Cloud-gateway routing, no-reload switching, workflow retention, permissions, and bootstrap race handling. | Backend dependency: [cloud#6635](Comfy-Org/cloud#6635) is required and merged. Its Local/Desktop CORS scope covers `POST /api/auth/token`, `GET /api/workspaces`, and `GET`/`POST /api/billing/*`; Local keeps workspace creation hidden. The backend PR is merged into `main`, and its production manifest contains the loopback origins. A live preflight currently passes on `testcloud.comfy.org`, while `cloud.comfy.org` still omits `Access-Control-Allow-Origin` for loopback origins. No additional backend code change is currently identified; the remaining release check is to confirm the merged configuration has rolled out to the production runtime and repeat the preflight. [#15151](#15151) independently fixes the existing Settings → Credits activity spinner and billing-portal rail. ## Plan / QA 1. Review the auth and persistence boundaries in this PR. 2. Land #15151 so activity and Invoice History follow the selected billing rail. 3. Confirm the merged cloud#6635 configuration has rolled out to the production runtime and repeat the live preflight. 4. Verify on a Desktop build against the deployed gateway: switch/relaunch, popover and Settings balances, top-up attribution, partner-node debit and allowlist, member permissions, and zero-credit local runs. Regression audit added a focused Local Playwright flow. It caught and fixed two release blockers: Local rendered the legacy profile popover even after workspace hydration, and `unified_cloud_auth=true` incorrectly selected an unavailable Cloud JWT outside the Cloud distribution. The E2E verifies workspace/role rendering, workspace token exchange, Cloud-gateway billing routing, and that switching neither reloads the document nor loses the open workflow tab. A second auth/accounting audit found two queue-time races: a prompt could be submitted without a workspace token while Local workspace bootstrap was in flight, or fall back to the personal Firebase identity after bootstrap failed. Queue authentication now shares and awaits the in-flight workspace initialization and fails closed if no active workspace can be established. Identity-generation guards prevent a previous user's initialization from overwriting the next user's state. Design of record: [MVP before/after](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=5874-73181) · [popover and switcher](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=5874-72771) The implementation references those prototype states: the profile popover gains the workspace row, the selector opens to the left, and the selected workspace is highlighted with a check while roles remain visible. Local-specific adaptations are the compact single-line trigger and the retained Credits entry, because this scope adds wallet switching without exposing Cloud workspace management. | AS IS — Local profile menu | TO BE — Local workspace selector | | --- | --- | |  |  | Captured from the actual Local frontend at 1920×1200 with deterministic auth/workspace/billing API fixtures; no Figma image is substituted for the implementation capture. ## Validation - Focused Local workspace Playwright E2E: 1/1 passed on Chromium before the final auth-race patch; final local rerun was blocked during fixture setup because the 8188 ComfyUI test backend was unavailable, before any product assertion ran - Final focused workspace/auth/queue unit suites: 316/316 passed when run in their stable focused groups - Earlier affected unit/component suites: 650/650 passed before rebase; 594/594 passed after rebase - `pnpm typecheck` - targeted ESLint and oxfmt checks - `pnpm knip` reports only existing repository-wide unused dependency/export findings - Real-app screenshot Playwright run: 2/2 passed (AS IS without a workspace roster; TO BE with the selector open) - Live CORS preflight: staging passes; production runtime rollout/sync verification remains the release blocker Linear: [FE-1584](https://linear.app/comfyorg/issue/FE-1584/add-workspace-switcher-to-localdesktop-credits-only-no-settings) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: comfydesigner <alextov@comfy.org>
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright: ✅ 1825 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-21T13:46:20.663Z",
"gitSha": "d1079a0aeab5f590f81432197e585cb8b9406573",
"branch": "dante01yoon/backport-15164-to-core-1.51",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2052.1590000000174,
"styleRecalcs": 12,
"styleRecalcDurationMs": 5.594999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 332.962,
"heapDeltaBytes": 5005400,
"heapUsedBytes": 70636732,
"domNodes": 24,
"jsHeapTotalBytes": 23855104,
"scriptDurationMs": 7.621000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2003.8129999999796,
"styleRecalcs": 11,
"styleRecalcDurationMs": 4.813999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 306.436,
"heapDeltaBytes": 5067312,
"heapUsedBytes": 70516704,
"domNodes": 22,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 4.756999999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1705.0229999999829,
"styleRecalcs": 72,
"styleRecalcDurationMs": 23.149,
"layouts": 12,
"layoutDurationMs": 2.725,
"taskDurationMs": 619.8720000000001,
"heapDeltaBytes": 21552,
"heapUsedBytes": 65518460,
"domNodes": 53,
"jsHeapTotalBytes": 24121344,
"scriptDurationMs": 71.2,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1690.119999999979,
"styleRecalcs": 73,
"styleRecalcDurationMs": 20.482,
"layouts": 12,
"layoutDurationMs": 1.977,
"taskDurationMs": 518.06,
"heapDeltaBytes": -97004,
"heapUsedBytes": 65245164,
"domNodes": 57,
"jsHeapTotalBytes": 25694208,
"scriptDurationMs": 60.32699999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1706.8669999999884,
"styleRecalcs": 31,
"styleRecalcDurationMs": 11.385,
"layouts": 6,
"layoutDurationMs": 0.55,
"taskDurationMs": 249.206,
"heapDeltaBytes": 8421520,
"heapUsedBytes": 74128940,
"domNodes": 78,
"jsHeapTotalBytes": 23855104,
"scriptDurationMs": 6.440000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1710.5289999999513,
"styleRecalcs": 30,
"styleRecalcDurationMs": 10.000000000000002,
"layouts": 6,
"layoutDurationMs": 0.4789999999999999,
"taskDurationMs": 250.30200000000002,
"heapDeltaBytes": 8131800,
"heapUsedBytes": 73579688,
"domNodes": 78,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 6.557000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 499.7099999999932,
"styleRecalcs": 13,
"styleRecalcDurationMs": 5.814000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 281.385,
"heapDeltaBytes": -11880892,
"heapUsedBytes": 53783700,
"domNodes": 22,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 39.977000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 442.9810000000316,
"styleRecalcs": 12,
"styleRecalcDurationMs": 4.907,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 252.16099999999997,
"heapDeltaBytes": -11844692,
"heapUsedBytes": 53670208,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 31.901,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 1996.6019999999958,
"styleRecalcs": 9,
"styleRecalcDurationMs": 4.899000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 430.063,
"heapDeltaBytes": 12890612,
"heapUsedBytes": 73086624,
"domNodes": -282,
"jsHeapTotalBytes": 2457600,
"scriptDurationMs": 10.834,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2009.5900000000597,
"styleRecalcs": 10,
"styleRecalcDurationMs": 4.827000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 433.8859999999999,
"heapDeltaBytes": 6778588,
"heapUsedBytes": 69399540,
"domNodes": -281,
"jsHeapTotalBytes": 4030464,
"scriptDurationMs": 8.126999999999999,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2055.552999999975,
"styleRecalcs": 68,
"styleRecalcDurationMs": 9.456,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 781.4499999999999,
"heapDeltaBytes": 8358880,
"heapUsedBytes": 69578716,
"domNodes": -282,
"jsHeapTotalBytes": 3174400,
"scriptDurationMs": 211.32299999999998,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2068.312999999989,
"styleRecalcs": 68,
"styleRecalcDurationMs": 8.642999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 752.864,
"heapDeltaBytes": 8716752,
"heapUsedBytes": 72200632,
"domNodes": -282,
"jsHeapTotalBytes": 3174400,
"scriptDurationMs": 191.59500000000003,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3070.475999999985,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.800999999999998,
"layouts": 60,
"layoutDurationMs": 6.425999999999999,
"taskDurationMs": 867.038,
"heapDeltaBytes": 16962344,
"heapUsedBytes": 79229240,
"domNodes": 16,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 232.16500000000002,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3075.1659999999674,
"styleRecalcs": 67,
"styleRecalcDurationMs": 11.548000000000002,
"layouts": 60,
"layoutDurationMs": 5.877999999999999,
"taskDurationMs": 891.449,
"heapDeltaBytes": 16953012,
"heapUsedBytes": 79385048,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 236.69799999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 1997.1080000000256,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.056000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 414.311,
"heapDeltaBytes": 13271172,
"heapUsedBytes": 74690436,
"domNodes": -282,
"jsHeapTotalBytes": 2457600,
"scriptDurationMs": 8.545,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2002.9230000000098,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.424999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 424.242,
"heapDeltaBytes": 7578004,
"heapUsedBytes": 70696420,
"domNodes": -280,
"jsHeapTotalBytes": 2457600,
"scriptDurationMs": 9.873999999999997,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 410.95999999998867,
"styleRecalcs": 49,
"styleRecalcDurationMs": 6.635000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 260.541,
"heapDeltaBytes": -10004344,
"heapUsedBytes": 55585700,
"domNodes": 22,
"jsHeapTotalBytes": 25427968,
"scriptDurationMs": 68.334,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 456.03700000003755,
"styleRecalcs": 49,
"styleRecalcDurationMs": 6.954,
"layouts": 1,
"layoutDurationMs": 0.06799999999999992,
"taskDurationMs": 263.45199999999994,
"heapDeltaBytes": -9927932,
"heapUsedBytes": 55643684,
"domNodes": 22,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 73.646,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 1998.9029999999843,
"styleRecalcs": 11,
"styleRecalcDurationMs": 5.649000000000001,
"layouts": 1,
"layoutDurationMs": 0.09499999999999992,
"taskDurationMs": 328.686,
"heapDeltaBytes": 5400576,
"heapUsedBytes": 70909244,
"domNodes": 22,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 6.209000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 1989.6100000000274,
"styleRecalcs": 12,
"styleRecalcDurationMs": 5.847999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 303.616,
"heapDeltaBytes": 5357132,
"heapUsedBytes": 70879180,
"domNodes": 24,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 4.417000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1723.6350000000016,
"styleRecalcs": 77,
"styleRecalcDurationMs": 25.580000000000002,
"layouts": 16,
"layoutDurationMs": 3.516,
"taskDurationMs": 557.8799999999999,
"heapDeltaBytes": -3880636,
"heapUsedBytes": 61949416,
"domNodes": 67,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 55.83,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1718.6599999999999,
"styleRecalcs": 78,
"styleRecalcDurationMs": 20.987,
"layouts": 16,
"layoutDurationMs": 2.3260000000000005,
"taskDurationMs": 490.311,
"heapDeltaBytes": -3704296,
"heapUsedBytes": 62113748,
"domNodes": 66,
"jsHeapTotalBytes": 23855104,
"scriptDurationMs": 46.947,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 831.957999999986,
"styleRecalcs": 20,
"styleRecalcDurationMs": 20.045,
"layouts": 15,
"layoutDurationMs": 7.786999999999999,
"taskDurationMs": 602.8359999999999,
"heapDeltaBytes": -6052568,
"heapUsedBytes": 79700340,
"domNodes": 13673,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 10.582999999999995,
"eventListeners": 2373,
"totalBlockingTimeMs": 85,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8108.947,
"styleRecalcs": 250,
"styleRecalcDurationMs": 24.658999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2652.4189999999994,
"heapDeltaBytes": 3320372,
"heapUsedBytes": 65631032,
"domNodes": -280,
"jsHeapTotalBytes": 3698688,
"scriptDurationMs": 616.8549999999999,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8075.513999999998,
"styleRecalcs": 249,
"styleRecalcDurationMs": 25.15,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2597.874,
"heapDeltaBytes": 2550760,
"heapUsedBytes": 62772524,
"domNodes": -282,
"jsHeapTotalBytes": 3698688,
"scriptDurationMs": 611.456,
"eventListeners": -163,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10472.316999999975,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9184.639000000001,
"heapDeltaBytes": -37830632,
"heapUsedBytes": 172968552,
"domNodes": -8312,
"jsHeapTotalBytes": -6492160,
"scriptDurationMs": 54.031,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10451.702999999952,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9219.774,
"heapDeltaBytes": -39191356,
"heapUsedBytes": 173290256,
"domNodes": -8317,
"jsHeapTotalBytes": -8065024,
"scriptDurationMs": 65.47500000000001,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-large-graph-pan",
"durationMs": 13030.114000000027,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.170999999999989,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12288.451,
"heapDeltaBytes": -27108416,
"heapUsedBytes": 170394528,
"domNodes": -8312,
"jsHeapTotalBytes": -14692352,
"scriptDurationMs": 370.281,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 12933.850000000006,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.121999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12235.736,
"heapDeltaBytes": -20452120,
"heapUsedBytes": 190429020,
"domNodes": -8312,
"jsHeapTotalBytes": -4726784,
"scriptDurationMs": 326.65,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 424.68200000001843,
"styleRecalcs": 16,
"styleRecalcDurationMs": 13.174000000000001,
"layouts": 2,
"layoutDurationMs": 0.36699999999999994,
"taskDurationMs": 75.04699999999998,
"heapDeltaBytes": 4990544,
"heapUsedBytes": 69580396,
"domNodes": 130,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 5.847999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 425.487999999973,
"styleRecalcs": 15,
"styleRecalcDurationMs": 11.708000000000002,
"layouts": 2,
"layoutDurationMs": 0.34199999999999997,
"taskDurationMs": 74.432,
"heapDeltaBytes": 4983056,
"heapUsedBytes": 69676800,
"domNodes": 125,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 5.4830000000000005,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
🎨 Storybook: 🚧 Building... |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## core/1.51 #15558 +/- ##
=============================================
+ Coverage 81.50% 81.53% +0.02%
=============================================
Files 1883 1884 +1
Lines 117573 117713 +140
Branches 36709 36774 +65
=============================================
+ Hits 95830 95973 +143
+ Misses 21271 21270 -1
+ Partials 472 470 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
## Summary On Local, clicking Run silently did nothing when the active workspace has no active subscription (e.g. 0 credits) — for any workflow, with or without API nodes, on any login method. Scope the subscribe-to-run gate in the queue commands to Cloud so Local always queues. Found during 1.51 QA of the local workspace switcher ([Slack report](https://comfy-organization.slack.com/archives/C0932CGKT5K/p1787740255008649?thread_ts=1787034725.224329&cid=C0932CGKT5K)). ## Root cause The break is an interaction of three pieces: 1. `Comfy.QueuePrompt` / `Comfy.QueuePromptFront` / `Comfy.QueueSelectedOutputNodes` return early when `canAccessSubscriptionFeatures` is false (`useCoreCommands.ts`), with no distribution check. 2. Since the local workspace switcher (Comfy-Org#15558), Local routes billing to the workspace rail once workspace context loads (`useBillingRouting`). `useWorkspaceBilling.canAccessSubscriptionFeatures` is `statusData?.is_active ?? false` — unlike the legacy rail (`useSubscription.ts`), it has no `!isCloud → true` exemption, so an unsubscribed/zero-credit workspace reports false on Local. 3. The gate's fallback `showSubscriptionDialog` → `showPricingTable` starts with `if (!isCloud) return` (`useSubscriptionDialog.ts`), so on Local the block is invisible: no dialog, no toast, nothing. ```mermaid flowchart LR A[Run click] --> B[Comfy.QueuePrompt] B --> C{canAccessSubscriptionFeatures?} C -- "Local + workspace rail, is_active=false" --> D[showSubscriptionDialog] D --> E["showPricingTable: if (!isCloud) return"] E --> F[silent no-op — Run does nothing] C -- true --> G[app.queuePrompt] ``` ## How we change it Gate the three queue commands with `isCloud && !canAccessSubscriptionFeatures` — subscription gating is a Cloud concept, and this mirrors the legacy rail's own `!isCloud` exemption. The gate flag itself is left untouched: flipping `useWorkspaceBilling.canAccessSubscriptionFeatures` to true on Local would regress the Plan & Credits UI, which intentionally renders the unsubscribed state on Local (Comfy-Org#15828). Insufficient-credit handling for partner nodes is unaffected: the backend still rejects the prompt and the error-catalog path (`insufficient_credits` → top-up dialog) handles it, so Local behavior returns to server-driven. ## AS IS / TO BE - **AS IS**: Local + workspace with 0 credits → Run click is a silent no-op for every workflow (QA video in the Slack thread above). - **TO BE**: Local always queues. OSS workflows run; partner-node workflows surface the backend insufficient-credits error with top-up CTA. Cloud gating is unchanged (dialog still shown when unsubscribed). ## Tests - Unit (`useCoreCommands.test.ts`): Local + `canAccessSubscriptionFeatures=false` queues and shows no dialog (fails against the previous code); Cloud unsubscribed still blocks with the `subscribe_to_run` dialog; Cloud subscribed queues. ## Review Focus - The guard intentionally keys on distribution (`isCloud`), not on billing-rail internals, so bootstrap-time rail flapping on Local can never block Run.⚠️ Needs backport to `core/1.51` — this is a 1.51 release blocker.
## Summary On Local, clicking Run silently did nothing when the active workspace has no active subscription (e.g. 0 credits) — for any workflow, with or without API nodes, on any login method. Scope the subscribe-to-run gate in the queue commands to Cloud so Local always queues. Found during 1.51 QA of the local workspace switcher ([Slack report](https://comfy-organization.slack.com/archives/C0932CGKT5K/p1787740255008649?thread_ts=1787034725.224329&cid=C0932CGKT5K)). ## Root cause The break is an interaction of three pieces: 1. `Comfy.QueuePrompt` / `Comfy.QueuePromptFront` / `Comfy.QueueSelectedOutputNodes` return early when `canAccessSubscriptionFeatures` is false (`useCoreCommands.ts`), with no distribution check. 2. Since the local workspace switcher (#15558), Local routes billing to the workspace rail once workspace context loads (`useBillingRouting`). `useWorkspaceBilling.canAccessSubscriptionFeatures` is `statusData?.is_active ?? false` — unlike the legacy rail (`useSubscription.ts`), it has no `!isCloud → true` exemption, so an unsubscribed/zero-credit workspace reports false on Local. 3. The gate's fallback `showSubscriptionDialog` → `showPricingTable` starts with `if (!isCloud) return` (`useSubscriptionDialog.ts`), so on Local the block is invisible: no dialog, no toast, nothing. ```mermaid flowchart LR A[Run click] --> B[Comfy.QueuePrompt] B --> C{canAccessSubscriptionFeatures?} C -- "Local + workspace rail, is_active=false" --> D[showSubscriptionDialog] D --> E["showPricingTable: if (!isCloud) return"] E --> F[silent no-op — Run does nothing] C -- true --> G[app.queuePrompt] ``` ## How we change it Gate the three queue commands with `isCloud && !canAccessSubscriptionFeatures` — subscription gating is a Cloud concept, and this mirrors the legacy rail's own `!isCloud` exemption. The gate flag itself is left untouched: flipping `useWorkspaceBilling.canAccessSubscriptionFeatures` to true on Local would regress the Plan & Credits UI, which intentionally renders the unsubscribed state on Local (#15828). Insufficient-credit handling for partner nodes is unaffected: the backend still rejects the prompt and the error-catalog path (`insufficient_credits` → top-up dialog) handles it, so Local behavior returns to server-driven. ## AS IS / TO BE - **AS IS**: Local + workspace with 0 credits → Run click is a silent no-op for every workflow (QA video in the Slack thread above). - **TO BE**: Local always queues. OSS workflows run; partner-node workflows surface the backend insufficient-credits error with top-up CTA. Cloud gating is unchanged (dialog still shown when unsubscribed). ## Tests - Unit (`useCoreCommands.test.ts`): Local + `canAccessSubscriptionFeatures=false` queues and shows no dialog (fails against the previous code); Cloud unsubscribed still blocks with the `subscribe_to_run` dialog; Cloud subscribed queues. ## Review Focus - The guard intentionally keys on distribution (`isCloud`), not on billing-rail internals, so bootstrap-time rail flapping on Local can never block Run.⚠️ Needs backport to `core/1.51` — this is a 1.51 release blocker. (cherry picked from commit 4a67eb4)
## Summary On Local, clicking Run silently did nothing when the active workspace has no active subscription (e.g. 0 credits) — for any workflow, with or without API nodes, on any login method. Scope the subscribe-to-run gate in the queue commands to Cloud so Local always queues. Found during 1.51 QA of the local workspace switcher ([Slack report](https://comfy-organization.slack.com/archives/C0932CGKT5K/p1787740255008649?thread_ts=1787034725.224329&cid=C0932CGKT5K)). ## Root cause The break is an interaction of three pieces: 1. `Comfy.QueuePrompt` / `Comfy.QueuePromptFront` / `Comfy.QueueSelectedOutputNodes` return early when `canAccessSubscriptionFeatures` is false (`useCoreCommands.ts`), with no distribution check. 2. Since the local workspace switcher (#15558), Local routes billing to the workspace rail once workspace context loads (`useBillingRouting`). `useWorkspaceBilling.canAccessSubscriptionFeatures` is `statusData?.is_active ?? false` — unlike the legacy rail (`useSubscription.ts`), it has no `!isCloud → true` exemption, so an unsubscribed/zero-credit workspace reports false on Local. 3. The gate's fallback `showSubscriptionDialog` → `showPricingTable` starts with `if (!isCloud) return` (`useSubscriptionDialog.ts`), so on Local the block is invisible: no dialog, no toast, nothing. ```mermaid flowchart LR A[Run click] --> B[Comfy.QueuePrompt] B --> C{canAccessSubscriptionFeatures?} C -- "Local + workspace rail, is_active=false" --> D[showSubscriptionDialog] D --> E["showPricingTable: if (!isCloud) return"] E --> F[silent no-op — Run does nothing] C -- true --> G[app.queuePrompt] ``` ## How we change it Gate the three queue commands with `isCloud && !canAccessSubscriptionFeatures` — subscription gating is a Cloud concept, and this mirrors the legacy rail's own `!isCloud` exemption. The gate flag itself is left untouched: flipping `useWorkspaceBilling.canAccessSubscriptionFeatures` to true on Local would regress the Plan & Credits UI, which intentionally renders the unsubscribed state on Local (#15828). Insufficient-credit handling for partner nodes is unaffected: the backend still rejects the prompt and the error-catalog path (`insufficient_credits` → top-up dialog) handles it, so Local behavior returns to server-driven. ## AS IS / TO BE - **AS IS**: Local + workspace with 0 credits → Run click is a silent no-op for every workflow (QA video in the Slack thread above). - **TO BE**: Local always queues. OSS workflows run; partner-node workflows surface the backend insufficient-credits error with top-up CTA. Cloud gating is unchanged (dialog still shown when unsubscribed). ## Tests - Unit (`useCoreCommands.test.ts`): Local + `canAccessSubscriptionFeatures=false` queues and shows no dialog (fails against the previous code); Cloud unsubscribed still blocks with the `subscribe_to_run` dialog; Cloud subscribed queues. ## Review Focus - The guard intentionally keys on distribution (`isCloud`), not on billing-rail internals, so bootstrap-time rail flapping on Local can never block Run.⚠️ Needs backport to `core/1.51` — this is a 1.51 release blocker. (cherry picked from commit 4a67eb4)
Summary
Manual backport of #15164 to
core/1.51, preserving the original local/Desktop credit-workspace switching behavior and regression coverage.Changes
848cd39ed06a2da6fea389305cf7210a0a18c5eeonto the currentcore/1.51tip.d4910c5a0c7422e75a8e878248822032be6ab222).Verification
pnpm test:unit <24 changed workspace switcher/auth/billing/persistence test files>knip --cachepassed.Review Focus
Confirm local credit-workspace switching, workspace-auth routing, billing attribution, and local workflow persistence remain equivalent to #15164 on the 1.51 release line.