Repository navigation
FE-3079 fix(cloud): Run mints its workspace token from the web session - #19414
Conversation
With the web session on, getWorkspaceAuthToken went through the legacy rail, which never writes a token, so Run failed with User not authenticated. Mint the active workspace's token from the shared session mint instead, reusing its cache, single-flight and Retry-After handling. Failures resolve to undefined and are reported except for 401.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughWeb-session requests now expose workspace-token minting. Workspace-token lookup uses web-session requests when available, while existing token-selection paths remain in place when they are unavailable. Tests cover token selection and session behavior. ChangesWeb-session workspace authorization
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant authStore
participant webSessionRunToken
participant WebSessionRequests
participant cloudWebSessionStore
authStore->>webSessionRunToken: Request workspace auth token
webSessionRunToken->>WebSessionRequests: Obtain request scope
webSessionRunToken->>WebSessionRequests: Request workspaceToken(scope)
WebSessionRequests->>cloudWebSessionStore: Mint token for workspaceId
cloudWebSessionStore-->>WebSessionRequests: Return SessionTokenResult
WebSessionRequests-->>webSessionRunToken: Return token result
webSessionRunToken-->>authStore: Return credential token or undefined
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The supplied evidence identifies no actionable issue that would prevent merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The new Run path has checks for session identity, workspace changes, and failed token minting. The review did not establish an exploitable security issue, but the authorization of requested workspaces by the token service remains unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 6 | ❓ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation Bug-fix language is present in the title and commit subjects ( ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2160 passed, 0 failed📊 Browser Reports
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. Fallow gates on new findings in changed files only, so everything below was introduced or moved by this PR (9 changed files).
Pre-existing findings are baselined in Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 7b7dfb3b39d2dc70107b064d445df3ddde8470b5
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 📦 Bundle: 10 MB gzip 🔴 +345 kBDetailsSummary
Category Glance App Entry Points — 3.77 kB (baseline 3.73 kB) • 🔴 +38 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.45 MB (baseline 1.43 MB) • 🔴 +27.2 kBGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 133 kB (baseline 124 kB) • 🔴 +9.54 kBTop-level views, pages, and routed surfaces
Status: 17 added / 16 removed / 1 unchanged Panels & Settings — 643 kB (baseline 621 kB) • 🔴 +21.7 kBConfiguration panels, inspectors, and settings screens
Status: 28 added / 27 removed User & Accounts — 39.4 kB (baseline 27.8 kB) • 🔴 +11.6 kBAuthentication, profile, and account management bundles
Status: 9 added / 9 removed / 2 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • 🔴 +691 BModals, dialogs, drawers, and in-app editors
Status: 8 added / 8 removed UI Components — 125 kB (baseline 117 kB) • 🔴 +8.07 kBReusable component library chunks
Status: 16 added / 15 removed Data & Services — 4.06 MB (baseline 3.6 MB) • 🔴 +463 kBStores, services, APIs, and repositories
Status: 15 added / 16 removed Utilities & Hooks — 582 kB (baseline 559 kB) • 🔴 +23.2 kBHelpers, composables, and utility bundles
Status: 31 added / 30 removed / 6 unchanged Vendor & Third-Party — 17.4 MB (baseline 18.1 MB) • 🟢 -684 kBExternal libraries and shared vendor chunks
Status: 12 added / 12 removed / 6 unchanged Other — 17.9 MB (baseline 16.4 MB) • 🔴 +1.54 MBBundles that do not match a named category
Status: 178 added / 174 removed / 122 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-29T19:52:52.728Z",
"gitSha": "b98079aa276c2b0a58f8712ba68d08f26580f9ca",
"branch": "dante01yoon/fe-3079-run-token-on-session",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2009.6919999999727,
"styleRecalcs": 12,
"styleRecalcDurationMs": 4.694999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 482.982,
"heapDeltaBytes": -22410048,
"heapUsedBytes": 76336592,
"domNodes": -228,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 13.299000000000001,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2015.4720000000452,
"styleRecalcs": 11,
"styleRecalcDurationMs": 4.183000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 488.65200000000004,
"heapDeltaBytes": -17335508,
"heapUsedBytes": 62054072,
"domNodes": -228,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 13.431,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66611570247934,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1794.4870000000037,
"styleRecalcs": 74,
"styleRecalcDurationMs": 18.014999999999997,
"layouts": 12,
"layoutDurationMs": 4.362,
"taskDurationMs": 795.5369999999999,
"heapDeltaBytes": -21884316,
"heapUsedBytes": 76753012,
"domNodes": -228,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 144.577,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666355140186912,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1755.9100000000853,
"styleRecalcs": 73,
"styleRecalcDurationMs": 17.223000000000003,
"layouts": 12,
"layoutDurationMs": 4.095,
"taskDurationMs": 746.196,
"heapDeltaBytes": -409132,
"heapUsedBytes": 78462460,
"domNodes": -228,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 144.32600000000002,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1710.8329999999796,
"styleRecalcs": 31,
"styleRecalcDurationMs": 10.244,
"layouts": 6,
"layoutDurationMs": 1.1039999999999999,
"taskDurationMs": 341.75,
"heapDeltaBytes": -18636676,
"heapUsedBytes": 79786424,
"domNodes": 53,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 15.760999999999997,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66504854368932,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1715.4420000000528,
"styleRecalcs": 31,
"styleRecalcDurationMs": 9.895000000000001,
"layouts": 6,
"layoutDurationMs": 1.2489999999999999,
"taskDurationMs": 349.486,
"heapDeltaBytes": 1807616,
"heapUsedBytes": 81024824,
"domNodes": 53,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 16.105,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66601941747573,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 607.8579999999647,
"styleRecalcs": 13,
"styleRecalcDurationMs": 4.031999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 410.1140000000001,
"heapDeltaBytes": 18655944,
"heapUsedBytes": 97382920,
"domNodes": 0,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 142.406,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663888888888877,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 635.5469999999741,
"styleRecalcs": 13,
"styleRecalcDurationMs": 4.291999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 418.779,
"heapDeltaBytes": -1839456,
"heapUsedBytes": 96716720,
"domNodes": 0,
"jsHeapTotalBytes": 7864320,
"scriptDurationMs": 146.808,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665789473684214,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1044.8180000000207,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 729.977,
"heapDeltaBytes": 9360684,
"heapUsedBytes": 85129248,
"domNodes": 0,
"jsHeapTotalBytes": 3833856,
"scriptDurationMs": 53.901,
"eventListeners": 0,
"totalBlockingTimeMs": 427,
"frameDurationMs": 31.818181818181817,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1095.9930000000213,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 761.361,
"heapDeltaBytes": 9535472,
"heapUsedBytes": 85818912,
"domNodes": 0,
"jsHeapTotalBytes": 3047424,
"scriptDurationMs": 55.619,
"eventListeners": 0,
"totalBlockingTimeMs": 462,
"frameDurationMs": 32.34999999999999,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 793.2739999999967,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 415.2269999999998,
"heapDeltaBytes": 15834124,
"heapUsedBytes": 91229376,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 128.94899999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 164,
"frameDurationMs": 23.526470588235284,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 793.8749999999573,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 408.8759999999998,
"heapDeltaBytes": 16104760,
"heapUsedBytes": 90691124,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 127.17399999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 166,
"frameDurationMs": 23.529411764705884,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "extension-clean-combined-draw",
"durationMs": 8226.073999999982,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7261.8859999999995,
"heapDeltaBytes": -9819152,
"heapUsedBytes": 70306232,
"domNodes": 0,
"jsHeapTotalBytes": -14680064,
"scriptDurationMs": 5656.909,
"eventListeners": 0,
"totalBlockingTimeMs": 73,
"frameDurationMs": 24.94878787878788,
"p95FrameDurationMs": 50
},
{
"name": "extension-clean-combined-draw",
"durationMs": 8144.9929999999995,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7185.285000000001,
"heapDeltaBytes": 4157596,
"heapUsedBytes": 84855876,
"domNodes": 0,
"jsHeapTotalBytes": -6815744,
"scriptDurationMs": 5875.4710000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 56,
"frameDurationMs": 26.49185667752443,
"p95FrameDurationMs": 50
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 8448.161999999968,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7476.750000000001,
"heapDeltaBytes": -11689328,
"heapUsedBytes": 69342380,
"domNodes": 0,
"jsHeapTotalBytes": -13631488,
"scriptDurationMs": 5931.514,
"eventListeners": 0,
"totalBlockingTimeMs": 107,
"frameDurationMs": 25.072997032640952,
"p95FrameDurationMs": 50
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 7886.557000000039,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7004.554000000001,
"heapDeltaBytes": -1165136,
"heapUsedBytes": 79508984,
"domNodes": 0,
"jsHeapTotalBytes": -17039360,
"scriptDurationMs": 5523.705,
"eventListeners": 0,
"totalBlockingTimeMs": 43,
"frameDurationMs": 24.330555555555556,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "large-graph-idle",
"durationMs": 2041.187999999977,
"styleRecalcs": 9,
"styleRecalcDurationMs": 3.993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 634.2030000000001,
"heapDeltaBytes": -37118200,
"heapUsedBytes": 83043248,
"domNodes": -228,
"jsHeapTotalBytes": -98304,
"scriptDurationMs": 34.18,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536584,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2053.854000000001,
"styleRecalcs": 8,
"styleRecalcDurationMs": 3.207999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 630.9830000000001,
"heapDeltaBytes": -36690900,
"heapUsedBytes": 83366344,
"domNodes": -228,
"jsHeapTotalBytes": -360448,
"scriptDurationMs": 35.836000000000006,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665040650406507,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2162.803999999994,
"styleRecalcs": 69,
"styleRecalcDurationMs": 10.690000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1456.2630000000001,
"heapDeltaBytes": 19846172,
"heapUsedBytes": 82590752,
"domNodes": -228,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 713.4209999999999,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2148.9799999999377,
"styleRecalcs": 69,
"styleRecalcDurationMs": 12.447000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1460.766,
"heapDeltaBytes": 24422372,
"heapUsedBytes": 87081652,
"domNodes": -228,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 715.658,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665625,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3371.15,
"styleRecalcs": 64,
"styleRecalcDurationMs": 12.249,
"layouts": 60,
"layoutDurationMs": 14.678,
"taskDurationMs": 1588.5819999999999,
"heapDeltaBytes": 8431404,
"heapUsedBytes": 73627172,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 706.503,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665841584158414,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3462.978000000021,
"styleRecalcs": 63,
"styleRecalcDurationMs": 11.962,
"layouts": 60,
"layoutDurationMs": 14.759000000000002,
"taskDurationMs": 1651.4719999999998,
"heapDeltaBytes": 12918548,
"heapUsedBytes": 77367560,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 741.8969999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666183574879224,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2873.993999999982,
"styleRecalcs": 45,
"styleRecalcDurationMs": 6.778,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1798.873,
"heapDeltaBytes": 17523488,
"heapUsedBytes": 81544908,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 891.6709999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.763742690058482,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2860.971999999947,
"styleRecalcs": 44,
"styleRecalcDurationMs": 6.435000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1785.225,
"heapDeltaBytes": 23200060,
"heapUsedBytes": 89345264,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 878.423,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.763529411764708,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2015.736000000004,
"styleRecalcs": 4,
"styleRecalcDurationMs": 1.575,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 567.9700000000001,
"heapDeltaBytes": 20912664,
"heapUsedBytes": 84551792,
"domNodes": -228,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 36.816,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760327,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2036.0130000000254,
"styleRecalcs": 8,
"styleRecalcDurationMs": 2.7849999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 591.33,
"heapDeltaBytes": 20674676,
"heapUsedBytes": 84152904,
"domNodes": -228,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 33.854,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 581.4139999999952,
"styleRecalcs": 48,
"styleRecalcDurationMs": 6.896000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 374.20200000000006,
"heapDeltaBytes": 12559124,
"heapUsedBytes": 93940248,
"domNodes": 0,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 129.589,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66285714285714,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 614.7519999999531,
"styleRecalcs": 49,
"styleRecalcDurationMs": 7.689,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 414.24999999999994,
"heapDeltaBytes": -22040776,
"heapUsedBytes": 59294788,
"domNodes": -214,
"jsHeapTotalBytes": -524288,
"scriptDurationMs": 131.579,
"eventListeners": -182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664864864864864,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2009.4950000000154,
"styleRecalcs": 11,
"styleRecalcDurationMs": 4.239000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 467.715,
"heapDeltaBytes": -27605576,
"heapUsedBytes": 53751040,
"domNodes": -244,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 12.066,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2041.058000000021,
"styleRecalcs": 10,
"styleRecalcDurationMs": 4.411,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.993,
"heapDeltaBytes": -8094476,
"heapUsedBytes": 73069000,
"domNodes": -244,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 12.591999999999999,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536587,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1728.5630000000083,
"styleRecalcs": 76,
"styleRecalcDurationMs": 18.867,
"layouts": 16,
"layoutDurationMs": 8.759,
"taskDurationMs": 721.7470000000001,
"heapDeltaBytes": -3781784,
"heapUsedBytes": 77091292,
"domNodes": -244,
"jsHeapTotalBytes": -262144,
"scriptDurationMs": 101.058,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666346153846156,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1743.4540000000425,
"styleRecalcs": 79,
"styleRecalcDurationMs": 19.004,
"layouts": 16,
"layoutDurationMs": 5.885,
"taskDurationMs": 731.164,
"heapDeltaBytes": -20830080,
"heapUsedBytes": 60663536,
"domNodes": -244,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 103.87599999999999,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665714285714287,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 1318.6909999999443,
"styleRecalcs": 17,
"styleRecalcDurationMs": 25.188999999999997,
"layouts": 5,
"layoutDurationMs": 10.196999999999997,
"taskDurationMs": 858.9739999999999,
"heapDeltaBytes": 23247192,
"heapUsedBytes": 104665808,
"domNodes": 13667,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 28.176999999999992,
"eventListeners": 2383,
"totalBlockingTimeMs": 102,
"frameDurationMs": 19.048571428571424,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8228.736999999966,
"styleRecalcs": 251,
"styleRecalcDurationMs": 39.218,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5346.967000000001,
"heapDeltaBytes": -36377688,
"heapUsedBytes": 83083024,
"domNodes": -228,
"jsHeapTotalBytes": -167936,
"scriptDurationMs": 2368.1180000000004,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665922920892495,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8179.082999999991,
"styleRecalcs": 251,
"styleRecalcDurationMs": 37.400000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5305.384,
"heapDeltaBytes": -36791820,
"heapUsedBytes": 83020576,
"domNodes": -228,
"jsHeapTotalBytes": 1175552,
"scriptDurationMs": 2384.7329999999997,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666122448979593,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 15165.083999999979,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15100.981000000002,
"heapDeltaBytes": -22697248,
"heapUsedBytes": 163442496,
"domNodes": -8049,
"jsHeapTotalBytes": -25165824,
"scriptDurationMs": 234.721,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.171604938271606,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-large-graph-idle",
"durationMs": 15261.936999999989,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15229.272,
"heapDeltaBytes": -37898100,
"heapUsedBytes": 199175948,
"domNodes": -8049,
"jsHeapTotalBytes": -12955648,
"scriptDurationMs": 239.184,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.534024896265556,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-large-graph-pan",
"durationMs": 17890.890000000014,
"styleRecalcs": 123,
"styleRecalcDurationMs": 18.98800000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17859.095,
"heapDeltaBytes": -13058900,
"heapUsedBytes": 166717868,
"domNodes": 0,
"jsHeapTotalBytes": -30932992,
"scriptDurationMs": 787.3919999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 26,
"frameDurationMs": 36.38069105691058,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-large-graph-pan",
"durationMs": 18400.17799999998,
"styleRecalcs": 124,
"styleRecalcDurationMs": 18.335999999999963,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18333.116,
"heapDeltaBytes": 23333056,
"heapUsedBytes": 187853380,
"domNodes": 0,
"jsHeapTotalBytes": -24449024,
"scriptDurationMs": 781.5559999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 31,
"frameDurationMs": 36.979718875502,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 5545.909999999993,
"styleRecalcs": 20,
"styleRecalcDurationMs": 64.277,
"layouts": 20,
"layoutDurationMs": 25.257,
"taskDurationMs": 5526.566,
"heapDeltaBytes": -22026848,
"heapUsedBytes": 200632172,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 105.20100000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 312,
"frameDurationMs": 35.349044585987265,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 5602.012000000059,
"styleRecalcs": 20,
"styleRecalcDurationMs": 63.657999999999994,
"layouts": 20,
"layoutDurationMs": 26.134000000000004,
"taskDurationMs": 5582.867,
"heapDeltaBytes": 4171476,
"heapUsedBytes": 190020768,
"domNodes": -8048,
"jsHeapTotalBytes": 22020096,
"scriptDurationMs": 101.912,
"eventListeners": -53,
"totalBlockingTimeMs": 302,
"frameDurationMs": 35.54683544303797,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7858.430000000055,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7828.659999999999,
"heapDeltaBytes": -4482712,
"heapUsedBytes": 186756860,
"domNodes": 0,
"jsHeapTotalBytes": -31981568,
"scriptDurationMs": 126.689,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.524899598393578,
"p95FrameDurationMs": 66.60000000000218
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7866.344000000026,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7818.981000000001,
"heapDeltaBytes": -14556076,
"heapUsedBytes": 187120300,
"domNodes": -3046,
"jsHeapTotalBytes": 8474624,
"scriptDurationMs": 118.21300000000001,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.847773279352218,
"p95FrameDurationMs": 50.099999999998545
},
{
"name": "workflow-execution",
"durationMs": 536.8080000000646,
"styleRecalcs": 21,
"styleRecalcDurationMs": 22.048,
"layouts": 5,
"layoutDurationMs": 2.707,
"taskDurationMs": 251.776,
"heapDeltaBytes": -42152552,
"heapUsedBytes": 54672004,
"domNodes": -119,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 18.936,
"eventListeners": -62,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66562499999999,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 458.57599999999366,
"styleRecalcs": 17,
"styleRecalcDurationMs": 17.933,
"layouts": 4,
"layoutDurationMs": 1.7840000000000003,
"taskDurationMs": 124.32799999999999,
"heapDeltaBytes": -14435716,
"heapUsedBytes": 82711392,
"domNodes": 101,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 10.754000000000001,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 843.3049999999866,
"styleRecalcs": 78,
"styleRecalcDurationMs": 109.96300000000001,
"layouts": 76,
"layoutDurationMs": 25.436,
"taskDurationMs": 813.615,
"heapDeltaBytes": 17531264,
"heapUsedBytes": 87525336,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 309.02000000000004,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66470588235295,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 890.0740000000269,
"styleRecalcs": 78,
"styleRecalcDurationMs": 114.965,
"layouts": 76,
"layoutDurationMs": 27.291,
"taskDurationMs": 854.801,
"heapDeltaBytes": -13780152,
"heapUsedBytes": 75474920,
"domNodes": 76,
"jsHeapTotalBytes": 7864320,
"scriptDurationMs": 324.577,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1411.1369999999397,
"styleRecalcs": 78,
"styleRecalcDurationMs": 275.685,
"layouts": 76,
"layoutDurationMs": 26.624,
"taskDurationMs": 1395.017,
"heapDeltaBytes": -5847464,
"heapUsedBytes": 126850332,
"domNodes": -7945,
"jsHeapTotalBytes": -3448832,
"scriptDurationMs": 418.91100000000006,
"eventListeners": -1245,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.488888888888894,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1351.8369999999322,
"styleRecalcs": 78,
"styleRecalcDurationMs": 263.41900000000004,
"layouts": 76,
"layoutDurationMs": 25.555,
"taskDurationMs": 1342.8200000000002,
"heapDeltaBytes": 2478804,
"heapUsedBytes": 134948284,
"domNodes": -7943,
"jsHeapTotalBytes": -3448832,
"scriptDurationMs": 392.186,
"eventListeners": -1228,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66543209876543,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #19414 +/- ##
==========================================
+ Coverage 84.16% 85.00% +0.83%
==========================================
Files 3237 2336 -901
Lines 156372 133419 -22953
Branches 42319 35913 -6406
==========================================
- Hits 131614 113412 -18202
+ Misses 23003 19644 -3359
+ Partials 1755 363 -1392
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 909 files with indirect coverage changes 🚀 New features to boost your workflow:
|
… auth unified_cloud_auth is on in production, so its branch ran before the session guard and a session-only tab got no Run token. Check the web session first; it is the source of truth whenever it is on.
christian-byrne
left a comment
There was a problem hiding this comment.
Run now asks the active web session for a token minted for this tab's selected workspace, while flag-off and non-session paths retain their existing credentials. Tokens are cached per workspace, revoked and rate-limited mints fail closed, sign-out cannot mint, and switching tabs or workspaces does not collapse workspace scope into browser-global state. The stack base exactly matches PR 19378's current head, exact-head CI is settled green, and no review thread is open.
The base branch was changed.
# Conflicts: # src/platform/auth/session/cloudWebSessionStore.ts # src/platform/auth/session/webSessionFetch.ts # src/platform/auth/webSessionFlagOn.test.ts
|
@christian-byrne #19378 landed, so this now targets main. I merged main in (6cd3c3a). The diff is the same five files as before, and the conflicts were only the squash of #19378 re-applying the same lines. Tests and typecheck pass. The base change dismissed your approval, so please re-approve. Heads-up for merge order: if #19390 lands first, this PR needs one more line in the agent consent test double ( |
christian-byrne
left a comment
There was a problem hiding this comment.
Approved. Run still mints its token for the workspace selected in this tab and does not collapse workspace selection into shared cross-tab state.
…ME and account-core (Comfy-Org#19449) ## Why FE-2893 says the READMEs follow the app slices. The billing-web README still describes only its own Firebase sign-in, and even lists a cookie-backed session as out of scope. The shared web session has no doc beside the package that implements it. ## How - `apps/billing-web/README.md`: the Authentication section now has a flag-off paragraph (unchanged text) and a `unified_web_session` paragraph. The new one covers how the mode is decided once per page load with an 800 ms cap, where identity and workspace come from, the cookie transport, and when Firebase loads. The scope list no longer denies a cookie session, and the section links the ADR. - `packages/account-core/docs/web-session.md` (new): an entry-point table with when to use each, the request-authorization matrix, the token mint rules, a `WebSessionErrorCode` table with the source of each code, and per-app usage for cloud, website and billing-web. Every export, path and behaviour was checked against the code on `main`. ## AS IS / TO BE There is no UI change. | Doc | AS IS | TO BE | | --- | --- | --- | | `apps/billing-web/README.md`, Current scope | Lists "a cookie-backed session transport" as not contained | Names the shared web session behind the flag and says it is read through `@comfyorg/account-core` | | `apps/billing-web/README.md`, Authentication | Firebase identity exchanged at `/api/auth/token` only | Same text for flag off, plus the flag-on path and the ADR link | | `packages/account-core/docs/web-session.md` | Does not exist | Entry points, authorization matrix, mint rules, error codes, per-app usage | ## Where this sits | PR | Ticket | Change | | --- | --- | --- | | Comfy-Org#19390 | FE-3079 part 1 | Web session follow-up | | Comfy-Org#19414 | FE-3079 part 2 | Web session follow-up | | F2a | FE-2900 | Mint failure copy | | F3a | FE-2899 | Website balance | | F4 | FE-2901 | API-key rows | | F5 | FE-2891 | Flag-off pins | | **F6 (this PR)** | FE-2893 | Docs | | F8 | FE-2904 | E2E Run, depends on Comfy-Org#19414 | ```mermaid graph LR A["Comfy-Org#19390 FE-3079 part 1"] --> R B["Comfy-Org#19414 FE-3079 part 2"] --> R B --> F8 C["F2a FE-2900 mint failure copy"] --> R D["F3a FE-2899 website balance"] --> R E["F4 FE-2901 API-key rows"] --> R F["F5 FE-2891 flag-off pins"] --> R G["F6 FE-2893 docs"] --> R F8["F8 FE-2904 E2E Run"] --> R R["FE-2907 ramp"] style G fill:#f9c74f,stroke:#000,stroke-width:3px,color:#000 ``` - Part of FE-2893
…credit action (Comfy-Org#19454) ## Why The other `useWorkshopCredits` callers still mint via Firebase in session mode. This continues Comfy-Org#19368, which moved the model page onto `useWorkshopModelBalance`. ## How Switch three callers from `useWorkshopCredits().balance` to `useWorkshopModelBalance(session)`: - `WorkflowPlayground.vue`, which takes `session` from `useWorkshopSession()` - `CinematicCreditAction.vue` - `useCinematicStudioRun.ts`, which already destructures `session` `useWorkshopModelBalance` binds once per page: the cookie balance for a personal workspace in session mode, the Firebase balance otherwise. The Firebase store is only started on the Firebase branch. `BuyCreditsDialog.vue` is unchanged. The request recorder from `workshop-model-balance.test.ts` moves to `config/__fixtures__/workshopCloudRecorder.ts` so both suites share it. ## AS IS / TO BE Requests from the three callers' balance path, per rollout state: | State | AS IS | TO BE | | --- | --- | --- | | Flag off (probe absent or false) | Firebase balance, no cookie request | Same: Firebase balance, no `/api/billing/balance` or `/api/auth/token` from the balance path | | Session mode, personal workspace | `POST /api/auth/token` with Firebase ID token, then `GET /api/billing/balance` with Bearer | One `GET /api/billing/balance` (cookie, `X-Comfy-Client`), no `/api/auth/token`, Firebase store not started | | Session mode, team workspace | Firebase balance | Balance unknown; the server's refusal still gates the run | Screenshots follow. ## Tests - New `BalanceCallers.test.ts` renders `WorkflowPlayground`, `CinematicStudio` and `CinematicCreditAction` against the recorder. - Session mode: exactly one cookie balance read, no `/api/auth/token`, `useWorkshopCredits` never called. - Flag off: Firebase balance read, no balance or token request. - Run gates: a funded cookie balance runs where an empty Firebase balance would not; flag off with an empty Firebase balance cannot run. - `WorkflowPlayground.test.ts` mocks `useWorkshopModelBalance` as `ModelDetail.test.ts` does. - Website unit suite: 512 files, 9779 tests pass. Website typecheck, oxlint, eslint and oxfmt are clean. - Mutation check: reverting each caller to `useWorkshopCredits` turns red. - `WorkflowPlayground`: the session-mode read test and the funded-gate test. - `CinematicCreditAction`: the session-mode read test. - `useCinematicStudioRun`: the session-mode read test and the funded-gate test. - `models-performance.spec.ts` passes. Total website JS is 8,828,894 B before and 8,828,836 B after (-58 B). ## Known limits - The Run gate still starts Firebase: `refreshWorkshopCredits` and the run path use the Firebase store. - Needs the backend to confirm that Router accepts session-minted tokens and that comfy.org is trusted for credentialed POSTs. - `BuyCreditsDialog` is skipped: it renders nothing in session mode, and top-up needs the Firebase token. ## Where this sits | Node | PR / ticket | Scope | | --- | --- | --- | | Comfy-Org#19390 | FE-3079 part 1 | Run token on session, part 1 | | Comfy-Org#19414 | FE-3079 part 2 | Run token on session, part 2 | | Comfy-Org#19452 | FE-2900 | Mint failure copy | | **F3a** | **FE-2899** | **Website balance (this PR)** | | Comfy-Org#19450 | FE-2901 | API-key rows | | Comfy-Org#19453 | FE-2891 | Flag-off pins | | Comfy-Org#19449 | FE-2893 | Docs | | F8 | FE-2904 | E2E Run (depends on Comfy-Org#19414) | | Ramp | FE-2907 | Fed by all of the above | ```mermaid graph LR A["Comfy-Org#19390 FE-3079 part 1"] --> R B["Comfy-Org#19414 FE-3079 part 2"] --> R B --> F8["F8 FE-2904 E2E Run"] C["Comfy-Org#19452 FE-2900 mint failure copy"] --> R D["F3a FE-2899 website balance"]:::this --> R E["Comfy-Org#19450 FE-2901 API-key rows"] --> R F["Comfy-Org#19453 FE-2891 flag-off pins"] --> R G["Comfy-Org#19449 FE-2893 docs"] --> R F8 --> R R["FE-2907 ramp"] classDef this fill:#ffd54f,stroke:#f57f17,stroke-width:3px,color:#000 ``` - Part of FE-2899
…ied_web_session is on (Comfy-Org#19450) ## Why FE-2901: API-key clients keep sending only `X-API-KEY`, whichever flags are on. `authorize()` must never mint or reach for a session for an `apiKey` principal, and an API-key login must produce no `/api/auth/session` traffic when `unified_web_session` is true. ## Root cause With `unified_web_session` on, an API-key user still resolves through `useCurrentUser`, so the `Comfy.Cloud.SessionCookie` `onAuthUserResolved` hook runs `useSessionCookie.createSession` -> `useCloudWebSessionStore.start()` -> `identity.boot()`, which sends a credentialed `GET /api/auth/session`. The new `uws:true` rows were red on main for exactly this. ## How `createSession` returns early when the flag is on and the login is an API-key login (`isApiKeyLogin`). It sits before `start()` and behind the flag check, so flag-off is byte-identical (including the existing `reportError` path). 8 non-test lines. ## AS IS / TO BE No UI change. | Case | AS IS | TO BE | | --- | --- | --- | | API-key login, `unified_web_session` true | `GET /api/auth/session` (credentials: include) after `POST /customers` | no session request; only `POST /customers` and `X-API-KEY` API calls | | API-key login, flag absent/false | `X-API-KEY` only | unchanged | | `authorize({kind:'apiKey'})` | `{headers:{'X-API-KEY'}}` | unchanged, now pinned | ## Tests - `requestAuth.test.ts`: `it.for` over {ingest, resource} x {GET, POST, DELETE} with an `apiKey` principal; result `toStrictEqual({headers:{'X-API-KEY'}})` (no `credentials`), `getWorkspaceToken` and `fetch` never called. - `nonWebClientsStayOnTokens.test.ts`: the authorizer built as `cloudWebSessionStore` builds it (real `createSessionTokenMint`, spied `getSession`/`fetchImpl`) returns `useApiKeyAuthStore().getAuthHeader()` and touches neither spy; `{uca:false,uws:true}` and `{uca:true,uws:true}` rows added to the API-key case with `expectNoSessionTraffic`. - On main the two `uws:true` rows were red (extra credentialed `GET /api/auth/session`); green with the fix. - Mutations, each reverted: `apiKey` calls `getWorkspaceToken` -> unit rows red; `apiKey` returns `credentials:'include'` -> unit and header rows red; guard removed -> both `uws:true` rows red. - `pnpm typecheck`, `pnpm lint`, `pnpm fallow:audit` clean. ## Where this sits | PR | Ticket | Scope | | --- | --- | --- | | Comfy-Org#19390 | FE-3079 part 1 | workspace API and agent consent on the session | | Comfy-Org#19414 | FE-3079 part 2 | Run token minted from the session | | F2a | FE-2900 | mint failure copy | | F3a | FE-2899 | website balance | | **F4 (this PR)** | FE-2901 | API-key rows | | F5 | FE-2891 | flag-off pins | | Comfy-Org#19449 | FE-2893 | docs | | F8 | FE-2904 | E2E Run (depends on Comfy-Org#19414) | | FE-2907 | ramp | all of the above feed in | ```mermaid graph LR A["Comfy-Org#19390 FE-3079 part 1"] --> R B["Comfy-Org#19414 FE-3079 part 2"] --> R C["F2a FE-2900 mint failure copy"] --> R D["F3a FE-2899 website balance"] --> R E["F4 FE-2901 API-key rows"] --> R F["F5 FE-2891 flag-off pins"] --> R G["F6 FE-2893 docs (Comfy-Org#19449)"] --> R B --> H["F8 FE-2904 E2E Run"] H --> R R["FE-2907 ramp"] style E fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:3px,color:#000 ``` - Part of FE-2901
…ession off (Comfy-Org#19453) ## Why FE-2891's criterion: with `unified_web_session` absent, the three apps issue the same network calls as main. Only the cloud app was pinned (`nonWebClientsStayOnTokens.test.ts`). The website had no request-level pin, and billing-web pinned main only relatively (the flag-off rows were compared against a run of the same code, so a change that hit both sides passed). ## How Tests only, no production change. - **website**: new `workshop-flag-off.requests.test.ts`. Real `workshop-account`, `workshop-session-state`, `workshop-credits`, `workshop-account-source` and `workshop-model-balance` run over a recording `fetch`. Only `workshop-firebase` (signed-in user, `getIdToken` -> `id-token`) and `scripts/posthog` (auth flag on) are mocked. Flow: boot, header balance, model-page balance, a direct session freshness check (`ensureFresh`), refocus, sign-out. Each request records `{method, url, credentials, header names, authorization, client, body}` and is compared to a literal golden. `setTimeout` is faked and never advanced, so the 800 ms account-source cap cannot fire. - **billing-web**: `billingWebAuth.flagOff.test.ts` gains a literal `MAIN_GOLDEN` next to the existing relative check, plus an entry-link workspace rebind flow and a sign-out flow. Golden values were captured by running main's code, not written by hand. ## AS IS / TO BE No UI change. | | AS IS | TO BE | |---|---|---| | website, probe absent / `false` | unpinned | anonymous `GET /api/features` (`credentials: 'omit'`, no headers), then `POST /api/auth/token` (Bearer id-token), `GET /api/billing/balance` (Bearer jwt), a targeted `POST /api/auth/token` for the freshness check, one more balance read on refocus, nothing on sign-out | | website, probe `true` + flag `false` / `'true'` (string) | unpinned | same, plus one credentialed `GET /api/features` (`credentials: 'include'`, `X-Comfy-Client`) | | website, all rows | no assertion on `/api/auth/session` or `X-CSRF-Token` | neither ever appears; header names are pinned, so an extra header fails | | billing-web sign-in + billing call | compared only to a run of the same code | literal: features, `POST /api/auth/token` `{}`, `POST /api/auth/token` `{workspace_id: 'ws-1'}`, `GET /api/billing/status`, with header names and `Authorization` values | | billing-web entry link -> `ws-2` | unpinned | exactly one `POST /api/auth/token` `{workspace_id: 'ws-2'}`, however often the link repeats | | billing-web sign-out | unpinned | stored credential dropped, no request | ## Tests `pnpm --filter @comfyorg/website test:unit` (512 files, 9773 tests), `pnpm --filter @comfyorg/billing-web test:unit` (27 files, 312 tests), `pnpm typecheck:website`, `pnpm typecheck:billing-web`: green. Mutation checks, each reverted afterwards: | Mutation | Result | |---|---| | `decideAccountSource` returns `'session'` when the probe is false | website: 4/4 rows red | | `credentials: 'omit'` dropped from `readWebSessionProbe` | website: 4/4 red | | flag read as true for the string `'true'` | website: the `'true'` row red; billing-web: the `'true'` row red | | `X-Comfy-Client` sent on the probe | website: 4/4 red | | billing-web default flips to web-session | billing-web: 9/10 red (timeouts, since the Firebase path never runs) | | extra header on the token exchange | website: 4/4 red; billing-web: 6/10 red | | entry-workspace re-mint removed | billing-web: rebind test red | ## Where this sits | Item | PR | Ticket | Depends on | |---|---|---|---| | Web session, part 1 | Comfy-Org#19390 | FE-3079 | | | Web session, part 2 | Comfy-Org#19414 | FE-3079 | Comfy-Org#19390 | | Comfy-Org#19452 | | FE-2900 mint failure copy | | | F3a | | FE-2899 website balance | | | Comfy-Org#19450 | | FE-2901 API-key rows | | | **F5 (this PR)** | | FE-2891 flag-off pins | | | Comfy-Org#19449 | | FE-2893 docs | | | Comfy-Org#19457 | | FE-2904 E2E Run | Comfy-Org#19414 | | Ramp | | FE-2907 | all of the above | ```mermaid graph LR P1["Comfy-Org#19390 FE-3079 part 1"] --> P2["Comfy-Org#19414 FE-3079 part 2"] P2 --> F8["F8 FE-2904 E2E Run"] F2a["Comfy-Org#19452 FE-2900 mint failure copy"] --> R["FE-2907 ramp"] F3a["F3a FE-2899 website balance"] --> R F4["Comfy-Org#19450 FE-2901 API-key rows"] --> R F5["F5 FE-2891 flag-off pins"] --> R F6["Comfy-Org#19449 FE-2893 docs"] --> R F8 --> R P1 --> R P2 --> R style F5 fill:#f9c74f,stroke:#000,stroke-width:3px,color:#000 ``` - Part of FE-2891
…rg#19457) ## Why Comfy-Org#19382 covered the queue path with `fetchApi('/prompt')` because Run did not yet take its token from the web session. With Comfy-Org#19390 and Comfy-Org#19414 it does, so the E2E should click the real Run button and prove the prompt carries the session-minted workspace token. ## How - `WEB_SESSION_MINT` in `fixtures/data/webSession.ts`, typed as `ExchangeTokenResponse` from `@comfyorg/ingest-types`. - `webSessionFixture` routes `**/api/auth/token` to that fixture and records each mint as `{ body, authorization, workspace }` instead of a string. - The fixture also mocks billing (`mockBilling`, active subscription) so Run is not replaced by the subscribe dialog. - Existing prompt tests click Run via `runDefaultWorkflow`; E2E-06 keeps `fetchApi` because it needs a bare request. - New test: exactly one mint `{ workspace_id: 'ws-team' }`, no `Authorization` header, `x-comfy-workspace-id: ws-team`, and `extra_data.auth_token_comfy_org === 'session-jwt-e2e'` on the prompt. - E2E-03: no mint after the switch, exactly one `ws-team` mint after Run. Needs Comfy-Org#19390 (billing reads on the session; without it Run opens the subscribe dialog) and Comfy-Org#19414 (the Run token). Both are merged into main. ## AS IS / TO BE No UI change. | Step | AS IS | TO BE | | --- | --- | --- | | Queue a prompt | `fetchApi('/prompt')` from `page.evaluate` | Load default workflow, click Run | | `/api/auth/token` | Not mocked, mints recorded as strings | Typed `ExchangeTokenResponse`, mints recorded with body, auth and workspace header | | Token asserted | None | One `ws-team` mint, prompt carries `session-jwt-e2e` | | E2E-03 mints | Empty after the whole flow | Empty after the switch, one `ws-team` mint after Run | ## Tests - `pnpm typecheck:browser`, oxlint and eslint on the touched files: clean. - `unifiedWebSession.spec.ts` against a production cloud build (`pnpm build:cloud`) served by a local ComfyUI backend, `--project=cloud`: 5 passed on main with Comfy-Org#19390 and Comfy-Org#19414 merged, no temporary merges. - Mutation: `webSessionRunToken` ignored (branch skipped) turns 3 tests red; token altered to `credential.token + 'x'` turns only the new token test red (`Received: "session-jwt-e2ex"`). Reverted. ## Where this sits | PR | Ticket | What | | --- | --- | --- | | Comfy-Org#19390 (merged) | FE-3079 part 1 | Workspace API and agent consent on the session | | Comfy-Org#19414 (merged) | FE-3079 part 2 | Run token from the session | | Comfy-Org#19452 | FE-2900 | Mint failure copy | | Comfy-Org#19454 | FE-2899 | Website balance | | Comfy-Org#19450 | FE-2901 | API-key rows | | Comfy-Org#19453 | FE-2891 | Flag-off pins | | Comfy-Org#19449 | FE-2893 | Docs | | **Comfy-Org#19457 (this PR)** | FE-2904 | E2E clicks Run, depends on Comfy-Org#19414 | | FE-2907 | ramp | All of the above feed into it | ```mermaid graph LR A["Comfy-Org#19390 FE-3079 part 1"] --> B["Comfy-Org#19414 FE-3079 part 2"] B --> F8["F8 FE-2904 E2E Run (this PR)"] F2a["Comfy-Org#19452 FE-2900 mint failure copy"] --> R["FE-2907 ramp"] F3a["Comfy-Org#19454 FE-2899 website balance"] --> R F4["Comfy-Org#19450 FE-2901 API-key rows"] --> R F5["Comfy-Org#19453 FE-2891 flag-off pins"] --> R F6["Comfy-Org#19449 FE-2893 docs"] --> R A --> R B --> R F8 --> R style F8 fill:#f9d648,stroke:Comfy-Org#333,stroke-width:3px ``` - Part of FE-2904
… fails (Comfy-Org#19452) ## Summary A failed web-session workspace-token mint showed the raw `SessionTokenError` text (`Workspace token mint failed: <CODE>`) in the toast; it now shows localized copy. ## Changes - **What**: - `authorizeResource` catches `SessionTokenError` and rethrows `WebSessionTokenError` (`webSessionFetch.ts`). It extends `SessionTokenError`, so `failure` is kept and `instanceof` still holds. Its `cause` is typed as the original error. - Five copy keys under `auth.webSession.token` (`ended`, `identityChanged`, `unavailable`, `workspaceDenied`, `refused`), typed from `enMessages`. A `Record<WebSessionErrorCode, key>` keeps all eight codes mapped. - `reportError` (`auth_session_token_mint_failure`, warning, tags `code` and `http_status`) is called with the original error, except for a 401 and for a no-status `NO_SESSION` or `IDENTITY_CHANGED`. Those are session lifecycle events, not service faults. A no-status network failure is reported. - Flag off is unchanged: `authorizeResource` is only provided when the session is on. Other callers of `webSessionResourceHeader` still get a `SessionTokenError` (now a subclass). | Failure code | AS IS | TO BE | | --- | --- | --- | | `NO_SESSION`, `SESSION_EXPIRED`, `SESSION_REVOKED` | `Workspace token mint failed: <CODE>` | Your session ended. Sign in again to continue. | | `IDENTITY_CHANGED` | `Workspace token mint failed: IDENTITY_CHANGED` | Your session changed. Reload to continue. | | `SESSION_UNAVAILABLE` | `Workspace token mint failed: SESSION_UNAVAILABLE` | We couldn't reach your account. Try again in a moment. | | `CSRF_STALE`, `SESSION_REQUEST_REFUSED` | `Workspace token mint failed: <CODE>` | Your request was refused. Reload the page and try again. | | `WORKSPACE_ACCESS_DENIED` | `Workspace token mint failed: WORKSPACE_ACCESS_DENIED` | You don't have access to this workspace. Contact support if this keeps happening. | ## Review Focus - `IDENTITY_CHANGED` also fires when the same account signs out mid-mint (`sessionTokenMint.ts` compares against an absent session), so its copy does not name another account. Returning `NO_SESSION` for an absent session is an account-core follow-up. - **Tests** (`webSessionFlagOn.test.ts`, `customerEventsService.test.ts`): - A table drives seven codes end to end through `webSessionResourceHeader`, asserting the literal English copy. - A held mint response plus a sign-out drives `IDENTITY_CHANGED`, asserting the copy and no report. - A sign-out before the mint asserts no report for `NO_SESSION`. - One test asserts the exact original error and exact tags are reported once. - One test asserts the wrapper is a `SessionTokenError` with the original as its `cause`. - A table of 401, 403, 429, 500 and a network failure covers the report boundary. - **Mutations**, each red and reverted: rethrow the raw error; report on a 401; never report; drop the tags; report the wrapped error; skip no-status failures; remove `IDENTITY_CHANGED` from the no-report set; remove `NO_SESSION` from it; `extends Error` instead of `SessionTokenError`; swap the `IDENTITY_CHANGED` or `WORKSPACE_ACCESS_DENIED` copy. - `pnpm typecheck`, `pnpm lint` (0 errors), `pnpm knip` pass. ## Where this sits Web-session follow-ups: Comfy-Org#19390 and Comfy-Org#19414 are merged; this PR is FE-2900. ```mermaid graph LR A["Comfy-Org#19390 FE-3079 part 1 (merged)"] --> C B["Comfy-Org#19414 FE-3079 part 2 (merged)"] --> C C["this PR: FE-2900 mint failure copy"] --> D["FE-2907 ramp"] style C fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:3px,color:#000 ``` - Part of [FE-2900](https://linear.app/comfyorg/issue/FE-2900)
Why
With
unified_web_sessionon, a tab signed in only by the web session (no Firebase user, e.g. arriving from the website) fails Run with "Prompt execution failed: User not authenticated", and nothing is queued. This is the second half of FE-3079; part 1 (#19390) covers the workspace API and agent consent.unified_cloud_authis at 100% in production. Under it, a Firebase-signed-in tab gets its Run token from the unified Cloud JWT, so the tab that breaks is the session-only one, which has no unified token.Root cause
app.tsreadsauthStore.getWorkspaceAuthToken()before queueing, so the prompt carriesextra_data.auth_token_comfy_org.unified_cloud_authon (production), it returnsgetUnifiedToken(). That token is minted from the Firebase user, so a session-only tab has none.recoverWorkspaceTokenroutes toswitchSessionWorkspace. That reads/workspaces/currentand never writes a token.How
WebSessionRequestsgets aworkspaceToken(scope)port.cloudWebSessionStore.start()wires it tomint.mint(workspaceId)on the same mint FE-2900 feat(cloud): comfy-api calls use the workspace token minted from the web session #19378 creates. That mint already provides:getWorkspaceAuthTokenmints the token for the scoped workspace (the team id, or personal when there is none). This check runs first, before the unified branch, so the session decides the Run token whetherunified_cloud_authis on or off.undefined, so Run shows the existing dialog and resets the queue, and the queue never gets stuck.reportError.webSessionRequests()check, so the flag-off paths run the same statements as before.Backend contract (cloud main): on
POST /api/prompt, ingest re-mintsauth_token_comfy_orgfor the request's workspace at submit time. It does this only when the client sent a non-empty token (prompt.go,partnernode_token.go), so the client must send a real one. Minting uses C8 (cloud#10585).AS IS / TO BE
POST /api/auth/tokenwith noworkspace_id, then the prompt is queuedApp-level screenshots to follow.
Tests
webSessionFlagOn.test.ts, through the real stores against the ingest mock, each case withunified_cloud_authoff and on:webSessionFlagOff.test.ts: the golden flow now also pins the Run token, and asserts it sends no requests.workspaceIddropped, the scope check dropped, a throwing mint, a new mint per call, an eager mint.Known limits
csrf_invalidon the mint is not retried, so that Run fails once.app.tsreads the token outside itstry. The new branch never rejects.unified_cloud_auth, other getters (getAuthHeader,getAuthToken,getWorkspaceAuthHeader) still return null on a session-only tab. Callers that need them are a follow-up.Where this sits