Repository navigation
FE-2891 feat(account-core): probe-gated unified_web_session readers for website and billing-web - #18874
Conversation
…or website and billing-web The anonymous /api/features document's global web_session_probe decides whether to send the credentialed read (credentials: include + X-Comfy-Client, cloud#10689); the per-user unified_web_session from that read, literal true only, is the answer. web_session_probe is a backend follow-up to cloud#10689 and not served yet. billing-web reads the probe from the features document it already fetches; the website adds one plain anonymous GET. Every failure resolves to off.
🌐 Website E2ETip All tests passed.
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2157 passed, 0 failed · 1 flaky📊 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. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since f48a9e91c40c179acc2e4a167155e5465fc49d3e
Full docs: ADR-DEVEX-LINT-0015 🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-18874.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-q1szqsmhd-comfyui.vercel.app Last updated: 2026-09-28T11:33:37Z for 📦 Bundle: 10 MB gzip 🔴 +322 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) • 🔴 +26.6 kBGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 134 kB (baseline 124 kB) • 🔴 +9.77 kBTop-level views, pages, and routed surfaces
Status: 17 added / 16 removed / 1 unchanged Panels & Settings — 640 kB (baseline 621 kB) • 🔴 +18.4 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) • 🔴 +690 BModals, dialogs, drawers, and in-app editors
Status: 8 added / 8 removed UI Components — 125 kB (baseline 117 kB) • 🔴 +8.02 kBReusable component library chunks
Status: 16 added / 15 removed Data & Services — 4.01 MB (baseline 3.6 MB) • 🔴 +413 kBStores, services, APIs, and repositories
Status: 15 added / 16 removed Utilities & Hooks — 579 kB (baseline 559 kB) • 🔴 +19.9 kBHelpers, composables, and utility bundles
Status: 30 added / 30 removed / 6 unchanged Vendor & Third-Party — 17.4 MB (baseline 18.1 MB) • 🟢 -685 kBExternal libraries and shared vendor chunks
Status: 12 added / 12 removed / 6 unchanged Other — 17.9 MB (baseline 16.4 MB) • 🔴 +1.5 MBBundles that do not match a named category
Status: 179 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-28T11:45:02.938Z",
"gitSha": "242e3c2889fd0b78291c4e38de93f4ae079cc030",
"branch": "dante01yoon/fe-2891-site-flag-readers",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2009.258999999986,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.372,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.53,
"heapDeltaBytes": -21680484,
"heapUsedBytes": 76269548,
"domNodes": -228,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 10.286,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2030.9349999999995,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.8720000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 417.698,
"heapDeltaBytes": -2484792,
"heapUsedBytes": 76592276,
"domNodes": -228,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 9.763000000000002,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1782.7070000000163,
"styleRecalcs": 79,
"styleRecalcDurationMs": 16.667,
"layouts": 12,
"layoutDurationMs": 4.223,
"taskDurationMs": 769.733,
"heapDeltaBytes": -18703832,
"heapUsedBytes": 60200428,
"domNodes": -228,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 139.882,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66635514018692,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1783.5379999999077,
"styleRecalcs": 75,
"styleRecalcDurationMs": 16.830000000000002,
"layouts": 12,
"layoutDurationMs": 4.505999999999999,
"taskDurationMs": 807.691,
"heapDeltaBytes": -20751572,
"heapUsedBytes": 58542484,
"domNodes": -228,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 152.226,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66635514018692,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1734.218999999996,
"styleRecalcs": 31,
"styleRecalcDurationMs": 9.967000000000002,
"layouts": 6,
"layoutDurationMs": 1.4959999999999998,
"taskDurationMs": 323.147,
"heapDeltaBytes": -18390368,
"heapUsedBytes": 80144964,
"domNodes": 53,
"jsHeapTotalBytes": 7602176,
"scriptDurationMs": 11.272,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666346153846145,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1732.70500000001,
"styleRecalcs": 31,
"styleRecalcDurationMs": 9.255,
"layouts": 6,
"layoutDurationMs": 1.363,
"taskDurationMs": 314.478,
"heapDeltaBytes": 1507056,
"heapUsedBytes": 80781520,
"domNodes": 53,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 11.55,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666346153846145,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 639.8870000000443,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.9,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 403.99999999999994,
"heapDeltaBytes": 18116016,
"heapUsedBytes": 97475076,
"domNodes": 0,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 146.655,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665789473684214,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 675.1329999999598,
"styleRecalcs": 13,
"styleRecalcDurationMs": 3.603,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 419.049,
"heapDeltaBytes": 18197868,
"heapUsedBytes": 97017056,
"domNodes": 0,
"jsHeapTotalBytes": 4194304,
"scriptDurationMs": 149.52499999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664999999999985,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1124.2780000000039,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 765.0859999999999,
"heapDeltaBytes": 6432188,
"heapUsedBytes": 83457788,
"domNodes": 0,
"jsHeapTotalBytes": 3571712,
"scriptDurationMs": 61.79699999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 493,
"frameDurationMs": 33.83636363636365,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1193.002999999976,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 849.165,
"heapDeltaBytes": 12975288,
"heapUsedBytes": 88480872,
"domNodes": 0,
"jsHeapTotalBytes": 3833856,
"scriptDurationMs": 61.65,
"eventListeners": 0,
"totalBlockingTimeMs": 577,
"frameDurationMs": 36.36363636363637,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 780.5539999999951,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 394.028,
"heapDeltaBytes": 14082624,
"heapUsedBytes": 92167432,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 126.01099999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 149,
"frameDurationMs": 23.04117647058825,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 780.8770000000322,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 384.7510000000001,
"heapDeltaBytes": 14245992,
"heapUsedBytes": 88593736,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 121.219,
"eventListeners": 0,
"totalBlockingTimeMs": 151,
"frameDurationMs": 23.03823529411768,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "extension-clean-combined-draw",
"durationMs": 8238.402000000007,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7385.303000000001,
"heapDeltaBytes": -1581932,
"heapUsedBytes": 79105636,
"domNodes": 0,
"jsHeapTotalBytes": -11534336,
"scriptDurationMs": 5763.486,
"eventListeners": 0,
"totalBlockingTimeMs": 123,
"frameDurationMs": 28.041979522184302,
"p95FrameDurationMs": 50
},
{
"name": "extension-clean-combined-draw",
"durationMs": 7520.699000000036,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6872.561,
"heapDeltaBytes": -9435604,
"heapUsedBytes": 71203708,
"domNodes": 0,
"jsHeapTotalBytes": -9175040,
"scriptDurationMs": 5557.892,
"eventListeners": 0,
"totalBlockingTimeMs": 79,
"frameDurationMs": 29.879282868525895,
"p95FrameDurationMs": 50
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 7818.354999999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7031.272000000001,
"heapDeltaBytes": -1749656,
"heapUsedBytes": 79257164,
"domNodes": 0,
"jsHeapTotalBytes": -15466496,
"scriptDurationMs": 5421.852,
"eventListeners": 0,
"totalBlockingTimeMs": 120,
"frameDurationMs": 27.658510638297876,
"p95FrameDurationMs": 50
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 8681.75400000007,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7854.772000000001,
"heapDeltaBytes": 5998876,
"heapUsedBytes": 86597228,
"domNodes": 0,
"jsHeapTotalBytes": 1572864,
"scriptDurationMs": 6238.59,
"eventListeners": 0,
"totalBlockingTimeMs": 185,
"frameDurationMs": 30.091319444444448,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "large-graph-idle",
"durationMs": 2037.8690000000006,
"styleRecalcs": 7,
"styleRecalcDurationMs": 2.386000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 521.087,
"heapDeltaBytes": -37629472,
"heapUsedBytes": 81942980,
"domNodes": -228,
"jsHeapTotalBytes": -622592,
"scriptDurationMs": 30.834,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2026.4760000000024,
"styleRecalcs": 8,
"styleRecalcDurationMs": 2.3050000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 514.3889999999999,
"heapDeltaBytes": -37400528,
"heapUsedBytes": 82345732,
"domNodes": -228,
"jsHeapTotalBytes": 425984,
"scriptDurationMs": 32.971000000000004,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2235.313000000019,
"styleRecalcs": 69,
"styleRecalcDurationMs": 9.969999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1461.82,
"heapDeltaBytes": -41574416,
"heapUsedBytes": 78730444,
"domNodes": -228,
"jsHeapTotalBytes": -397312,
"scriptDurationMs": 700.3040000000001,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666165413533836,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2269.0699999999424,
"styleRecalcs": 67,
"styleRecalcDurationMs": 9.055999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1488.6,
"heapDeltaBytes": 20744380,
"heapUsedBytes": 83335508,
"domNodes": 0,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 755.687,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66592592592593,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3554.889000000003,
"styleRecalcs": 63,
"styleRecalcDurationMs": 10.969,
"layouts": 60,
"layoutDurationMs": 14.622,
"taskDurationMs": 1502.9830000000002,
"heapDeltaBytes": 9763856,
"heapUsedBytes": 74169640,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 670.748,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665727699530517,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3633.3720000000085,
"styleRecalcs": 64,
"styleRecalcDurationMs": 11.318999999999999,
"layouts": 60,
"layoutDurationMs": 14.074,
"taskDurationMs": 1555.199,
"heapDeltaBytes": 13394440,
"heapUsedBytes": 77525572,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 711.585,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665137614678898,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3071.145999999999,
"styleRecalcs": 43,
"styleRecalcDurationMs": 5.363999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1730.205,
"heapDeltaBytes": 22866312,
"heapUsedBytes": 86622552,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 876.0799999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.757377049180324,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2935.613999999987,
"styleRecalcs": 45,
"styleRecalcDurationMs": 5.986999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1719.5919999999999,
"heapDeltaBytes": 17748948,
"heapUsedBytes": 82005368,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 850.276,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.76114285714286,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 1999.4980000000169,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.629000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 517.978,
"heapDeltaBytes": 20433200,
"heapUsedBytes": 83211968,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 31.663000000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2023.437000000058,
"styleRecalcs": 4,
"styleRecalcDurationMs": 1.2560000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 472.455,
"heapDeltaBytes": 20659392,
"heapUsedBytes": 83615976,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 31.347,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 564.4589999999994,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.498999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 363.58900000000006,
"heapDeltaBytes": 12304312,
"heapUsedBytes": 93665868,
"domNodes": 0,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 125.114,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667647058823523,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 579.6000000000276,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.090000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 353.353,
"heapDeltaBytes": 12590452,
"heapUsedBytes": 94121284,
"domNodes": 0,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 124.418,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66285714285714,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2026.7590000000268,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.3799999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 425.687,
"heapDeltaBytes": -19101980,
"heapUsedBytes": 62185820,
"domNodes": -244,
"jsHeapTotalBytes": -786432,
"scriptDurationMs": 7.654000000000001,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2019.410999999991,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.1059999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 412.815,
"heapDeltaBytes": -16540512,
"heapUsedBytes": 64899268,
"domNodes": -244,
"jsHeapTotalBytes": -262144,
"scriptDurationMs": 8.843999999999998,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1727.762000000041,
"styleRecalcs": 72,
"styleRecalcDurationMs": 17.230999999999998,
"layouts": 16,
"layoutDurationMs": 8.678999999999998,
"taskDurationMs": 753.201,
"heapDeltaBytes": -1332824,
"heapUsedBytes": 80013180,
"domNodes": -244,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 98.42899999999999,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66538461538462,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1749.9540000000025,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.987000000000002,
"layouts": 16,
"layoutDurationMs": 5.334999999999999,
"taskDurationMs": 671.7579999999999,
"heapDeltaBytes": -2735512,
"heapUsedBytes": 78612848,
"domNodes": -244,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 85.40400000000001,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66571428571429,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 966.7049999999904,
"styleRecalcs": 16,
"styleRecalcDurationMs": 24.462000000000003,
"layouts": 5,
"layoutDurationMs": 9.614,
"taskDurationMs": 781.8860000000001,
"heapDeltaBytes": 21632844,
"heapUsedBytes": 102122384,
"domNodes": 13667,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 25.675000000000004,
"eventListeners": 2383,
"totalBlockingTimeMs": 128,
"frameDurationMs": 21.015217391304343,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8284.78100000001,
"styleRecalcs": 251,
"styleRecalcDurationMs": 33.499,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5211.195,
"heapDeltaBytes": -36905892,
"heapUsedBytes": 82462888,
"domNodes": -228,
"jsHeapTotalBytes": -430080,
"scriptDurationMs": 2401.089,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665995975855132,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8279.699000000051,
"styleRecalcs": 251,
"styleRecalcDurationMs": 32.446,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5054.391,
"heapDeltaBytes": -36286000,
"heapUsedBytes": 82865872,
"domNodes": -228,
"jsHeapTotalBytes": 126976,
"scriptDurationMs": 2336.41,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666129032258063,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 14477.599999999995,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13884.637999999999,
"heapDeltaBytes": -7138692,
"heapUsedBytes": 186203296,
"domNodes": 0,
"jsHeapTotalBytes": -26476544,
"scriptDurationMs": 256.739,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 25.574336283185843,
"p95FrameDurationMs": 50
},
{
"name": "vue-large-graph-idle",
"durationMs": 14199.60500000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13365.938999999997,
"heapDeltaBytes": -965616,
"heapUsedBytes": 186999476,
"domNodes": -8049,
"jsHeapTotalBytes": -17563648,
"scriptDurationMs": 255.49299999999997,
"eventListeners": -3,
"totalBlockingTimeMs": 0,
"frameDurationMs": 24.148809523809526,
"p95FrameDurationMs": 33.5
},
{
"name": "vue-large-graph-pan",
"durationMs": 13591.739999999958,
"styleRecalcs": 66,
"styleRecalcDurationMs": 13.21899999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13016.445,
"heapDeltaBytes": -2508184,
"heapUsedBytes": 194092104,
"domNodes": 0,
"jsHeapTotalBytes": -23924736,
"scriptDurationMs": 736.283,
"eventListeners": 0,
"totalBlockingTimeMs": 14,
"frameDurationMs": 23.88789473684211,
"p95FrameDurationMs": 50
},
{
"name": "vue-large-graph-pan",
"durationMs": 17441.651999999976,
"styleRecalcs": 142,
"styleRecalcDurationMs": 17.216000000000008,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17055.497,
"heapDeltaBytes": -11365644,
"heapUsedBytes": 187736776,
"domNodes": -3046,
"jsHeapTotalBytes": 8159232,
"scriptDurationMs": 866.619,
"eventListeners": -14915,
"totalBlockingTimeMs": 55,
"frameDurationMs": 32.31370370370371,
"p95FrameDurationMs": 66.69999999999891
},
{
"name": "vue-node-resize-workload",
"durationMs": 5383.215000000007,
"styleRecalcs": 20,
"styleRecalcDurationMs": 72.788,
"layouts": 20,
"layoutDurationMs": 26.61400000000001,
"taskDurationMs": 5321.639,
"heapDeltaBytes": 947404,
"heapUsedBytes": 206906864,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 106.153,
"eventListeners": 0,
"totalBlockingTimeMs": 247,
"frameDurationMs": 33.540625,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 5155.287999999928,
"styleRecalcs": 20,
"styleRecalcDurationMs": 69.36899999999999,
"layouts": 20,
"layoutDurationMs": 23.957999999999995,
"taskDurationMs": 5063.365000000001,
"heapDeltaBytes": -19980236,
"heapUsedBytes": 197791456,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 94.786,
"eventListeners": 0,
"totalBlockingTimeMs": 199,
"frameDurationMs": 31.40121951219513,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7693.463000000009,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7521.193999999998,
"heapDeltaBytes": -30392824,
"heapUsedBytes": 160998972,
"domNodes": -3045,
"jsHeapTotalBytes": 9129984,
"scriptDurationMs": 129.37500000000003,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.728571428571417,
"p95FrameDurationMs": 66.59999999999854
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7335.9819999999445,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6887.937999999998,
"heapDeltaBytes": -67728420,
"heapUsedBytes": 161321728,
"domNodes": -3045,
"jsHeapTotalBytes": 2039808,
"scriptDurationMs": 123.65599999999999,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 24.80101694915254,
"p95FrameDurationMs": 49.89999999999782
},
{
"name": "workflow-execution",
"durationMs": 475.3499999999917,
"styleRecalcs": 19,
"styleRecalcDurationMs": 16.179,
"layouts": 3,
"layoutDurationMs": 1.8090000000000002,
"taskDurationMs": 134.46,
"heapDeltaBytes": -14109084,
"heapUsedBytes": 82414240,
"domNodes": 129,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 9.830000000000002,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379316,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 486.5119999999479,
"styleRecalcs": 19,
"styleRecalcDurationMs": 16.394,
"layouts": 4,
"layoutDurationMs": 2.167,
"taskDurationMs": 201.64700000000002,
"heapDeltaBytes": -43471728,
"heapUsedBytes": 53233832,
"domNodes": -122,
"jsHeapTotalBytes": 3145728,
"scriptDurationMs": 10.82,
"eventListeners": -62,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 631.7999999999984,
"styleRecalcs": 78,
"styleRecalcDurationMs": 93,
"layouts": 76,
"layoutDurationMs": 17.219,
"taskDurationMs": 583.1729999999999,
"heapDeltaBytes": -8250504,
"heapUsedBytes": 79457676,
"domNodes": 76,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 204.098,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665789473684214,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 650.8120000000872,
"styleRecalcs": 78,
"styleRecalcDurationMs": 95.271,
"layouts": 76,
"layoutDurationMs": 17.232,
"taskDurationMs": 609.812,
"heapDeltaBytes": 15298056,
"heapUsedBytes": 81110808,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 228.61399999999998,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667499999999997,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1085.9890000000405,
"styleRecalcs": 78,
"styleRecalcDurationMs": 227.659,
"layouts": 76,
"layoutDurationMs": 19.076,
"taskDurationMs": 1051.385,
"heapDeltaBytes": -20568732,
"heapUsedBytes": 108943476,
"domNodes": 76,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 309.952,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.923076923076938,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1149.0329999999176,
"styleRecalcs": 78,
"styleRecalcDurationMs": 232.178,
"layouts": 76,
"layoutDurationMs": 20.232,
"taskDurationMs": 1122.338,
"heapDeltaBytes": 13254020,
"heapUsedBytes": 128401708,
"domNodes": 76,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 342.658,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666197183098593,
"p95FrameDurationMs": 16.80000000000109
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
🧩 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 |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAccount-core adds functions to read the Cloud web-session probe and per-user flag. Billing-web and the website add cached readers that use these functions. Tests cover request behavior, flag values, caching, and failures. ChangesUnified web-session flag
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant AppReader
participant resolveUnifiedWebSession
participant CloudFeaturesAPI
AppReader->>resolveUnifiedWebSession: request session flag
resolveUnifiedWebSession->>CloudFeaturesAPI: anonymous GET /api/features
CloudFeaturesAPI-->>resolveUnifiedWebSession: web_session_probe
alt probe is true
resolveUnifiedWebSession->>CloudFeaturesAPI: credentialed no-store GET /api/features
CloudFeaturesAPI-->>resolveUnifiedWebSession: unified_web_session
end
resolveUnifiedWebSession-->>AppReader: boolean result
Suggested reviewers: Merge Risk: 🔵 Low · up to If a reader is called and its dynamic import fails, it rejects instead of returning false. The issue is bounded because the new readers have no production callers yet, but the fallback should be fixed before they are adopted. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new readers are not yet called by application features, and their default behavior is off. Before they are used, the backend probe contract and the lifetime of cached per-user results need to be settled. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18874 +/- ##
========================================
Coverage 84.14% 84.14%
========================================
Files 3164 3167 +3
Lines 155216 155254 +38
Branches 42163 42478 +315
========================================
+ Hits 130604 130641 +37
- Misses 23008 23009 +1
Partials 1604 1604
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Approving. Every failure path resolves to false, and the probe is correctly shaped to avoid the thing it exists to defer.
- The probe is a plain anonymous GET with no cookie and no custom header, so it triggers no CORS preflight — which is the point, since a preflight on the gate would defeat gating the preflight.
resolveUnifiedWebSessionreturns before the credentialed read when the probe is off, so the request and its preflight genuinely do not exist until rollout.- Two non-blocking notes: the timeout budget compounds, and
COMFY_CLIENTis now defined twice.
Full context for agent readers
Fail-closed, checked path by path. readFeatures returns undefined on a non-ok status, on a
throw, and on an abort; readsLiteralTrue(undefined, …) is false; probeIsOn wraps the probe in
its own try. readsLiteralTrue requires a literal true for both keys, so a stringy 'true' or a
1 from a proxy or a stub resolves off, consistent with the rule the cloud-app flag reader already
follows. clearTimeout in finally means an early return does not leave the timer armed. I could
not find a path that resolves true without the server having said so twice.
Note 1 — the timeout budget compounds. Each readFeatures gets its own DEFAULT_TIMEOUT_MS, and
resolveUnifiedWebSession makes two sequential calls, so the worst case before resolving false is
10 s rather than 5. That is invisible today because nothing calls these readers, but whoever wires
them into a boot path inherits it. A single deadline spanning both reads, or a shorter budget for the
probe specifically, would keep the guarantee that the answer arrives within a bounded time rather
than within twice a bounded time.
Note 2 — COMFY_CLIENT now exists twice, and the header is a security control. The comment
already flags this and names the convergence, which is the right way to carry it. Worth stating why
it matters beyond tidiness: on the backend this header is not telemetry, it is what forces a CORS
preflight so that the Origin check can see requests an <img> or <script> tag would otherwise
smuggle through without one. Two definitions of a value with that job can drift, and the drift would
be silent. If the request-auth work lands first, converging on its constant is the smaller change;
if this lands first, it is worth a test asserting the two agree rather than trusting the comment.
On the merge hold. The description already holds this on the probe contract settling, which is the
correct gate and is yours rather than mine — nothing calls these readers, so merging changes no
request. I am not adding a second hold; this approval is for the diff, and the contract gate stands.
One thing I checked and am satisfied with. Gating on a global anonymous key rather than a
per-user one is the right shape for a site that cannot ask who the user is: it is the only thing
knowable before the credentialed read, and it makes the rollout switch a server-side value rather
than a deploy. The per-user answer still comes from the credentialed unified_web_session, so the
probe widens nothing on its own.
…ite-flag-readers # Conflicts: # packages/account-core/package.json # packages/account-core/scripts/smokePack.ts # packages/account-core/src/webSessionInertImport.test.ts
73f4d4f
This comment has been minimized.
This comment has been minimized.
…ite-flag-readers # Conflicts: # packages/account-core/package.json # packages/account-core/scripts/smokePack.ts # packages/account-core/src/webSessionInertImport.test.ts
The features reader kept its own copy until requestAuth landed; X-Comfy-Client is what forces the preflight the backend's Origin check relies on, so it has one definition.
|
@christian-byrne Fixed in 6b19fc3. The dynamic The control is The merge is carried down to #18877, #18882, #18880 and #18881. |
christian-byrne
left a comment
There was a problem hiding this comment.
The fail-closed reader contract now includes client-header loading at 619f6865: a rejected dynamic import resolves the feature off before any credentialed read, and the focused regression test covers that boundary. The probe remains anonymous and the credentialed flag read remains scoped behind it.
Required CI is settled green and all review threads are resolved.
…omfy-Org#19002) ## Why The web session PRs merged with four non-blocking review notes from Christian, and CodeRabbit found one real defect after Comfy-Org#18719 merged. All of this code is on main now, so the fixes land together here. ## Root cause (the defect) `signedIn()` awaited `createWebSession` (a POST, then a GET) and then always dispatched `session_created` and published `sign_in`. It never checked whether `signOut()` had run in the meantime. - The cloud store starts the interactive session without awaiting it, so a user who logs out quickly hits exactly this window. - The tab went back to `signed_in`, and every signed-out sibling tab adopted the published `sign_in`. - If the POST reached the server after the DELETE, a live session cookie also stayed behind. The epoch alone can't catch this: a sign-out from a settling or idle state emits no `account_changed`, so the epoch never moves. ## How - **Sign-out wins over an in-flight sign-in** (CodeRabbit on Comfy-Org#18871, Major). `signOut()` bumps a sign-out counter, and `signedIn()` captures it before the POST. If the counter changed, the new session is: - not dispatched and not published; - deleted again, so no live cookie is left, unless a newer sign-in has started since (that sign-in owns the cookie now); - answered as `SESSION_REVOKED`, or with the cleanup's failure if the DELETE fails. - **FE-2894: adopt a live session when the remembered-login lookup throws** (Christian on Comfy-Org#18715). A failed `currentUserId()` used to discard a successful session read and retry. Now it only matters when there is no live session. With one, the lookup can skip nothing but the different-user sign-out, so the session is adopted. - **CSRF replay re-checks scope after the re-read** (Christian on Comfy-Org#18716). `stillInScope()` is checked again between the re-read and the replay, so a request superseded during that round trip is abandoned rather than replayed. - **Comments Christian asked for:** - on `zSharedMessage` (Comfy-Org#18719): the shared host-only cookie is what licenses trusting a sibling tab's answer; - in `mint()` (Comfy-Org#18870): the cache check deliberately precedes the backoff. ## Tests - **Sign-out during sign-in:** a lifecycle test holds the POST, signs out, then releases it. It checks that both the tab and its sibling stay `signed_out`, and that the late session is deleted (`DELETE, POST, GET, DELETE`). - **Lookup throws with a live session:** a boot test checks for `signed_in` with no retry and no local sign-out. The existing test for a failed lookup with no session (retry) still passes. - **Overlapping sign-ins:** a stale sign-in released after a newer one has succeeded sends no DELETE, and the tab stays signed in. - **Failed cleanup:** when the cleanup DELETE fails, the call answers `SESSION_UNAVAILABLE` instead of a clean revocation. - **Scope changes during the re-read:** a transport test checks for `SUPERSEDED` with no second send. - **Mutation check:** reverting any of the three fixes turns exactly its own test red. - `pnpm --filter @comfyorg/account-core` suite: 1199 passed. - The cloud auth tests pass, including the flag-off harness `src/platform/auth/webSessionFlagOff.test.ts`. - `fallow audit`: no issues in the changed files. ## Flag-off parity Every change sits on the web session path, which only runs with `unified_web_session` on. Flag-off behaviour is unchanged, and the flag-off harness passes. ## AS IS / TO BE | Case | AS IS | TO BE | | --- | --- | --- | | Sign out while an interactive sign-in is in flight | the tab and its siblings go back to `signed_in`; a cookie may remain | stays signed out; the late session is deleted | | Session live, remembered-login lookup throws | discards the session and retries | adopts the session | | Scope changes during the CSRF re-read | replays into the old scope | `SUPERSEDED`, no replay | This is library logic with no UI of its own; the tests above are the evidence. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2894 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | **FE-2894 (this PR)** | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715 merged; review follow-ups in this PR | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716 merged | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719 merged | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870 merged | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 merged (Desktop checks open) | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | Comfy-Org#18878, do not merge | | FE-2896 | website header | FE-2891 readers, FE-2894, C11 | Comfy-Org#18877, do not merge | | FE-2899 | website credits | FE-2896, FE-2895, C5 | Comfy-Org#18882, do not merge | | FE-2898 | billing-web on the session (A identity, B transport) | FE-2891 readers, FE-2894, FE-2895, C5 | Comfy-Org#18880 + Comfy-Org#18881, do not merge | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2894 thisPr ``` - Blocked by: none: all the code is on main - Unblocks: none; closes the review notes on Comfy-Org#18715, Comfy-Org#18716, Comfy-Org#18719 and Comfy-Org#18870, and a CodeRabbit finding on Comfy-Org#18871
|
@christian-byrne the lockfile-repair bot pushed |
christian-byrne
left a comment
There was a problem hiding this comment.
Re-approved on the refreshed head. The probe and credentialed readers still fail closed, including a rejected dynamic client-header import, and the anonymous probe still omits credentials.
The head movement only incorporates landed main-branch changes: the session-token export and smoke import, inert-import coverage, and the repository typecheck command. The reviewed feature blobs are otherwise unchanged. All 115 checks are successful and there are no unresolved review threads.
Full context for agent readers
Compared 619f6865 with 70e0424d blob by blob across the PR's current file set. Eleven feature and test blobs are identical. The three changed blobs contain only the main-branch additions named above; the merge's lockfile resolution leaves no lockfile delta in this PR.
…ified_web_session (1/2) (Comfy-Org#18880) > **Do not merge.** Part 1 of 2 for FE-2898 (part 2, the transport, is Comfy-Org#18881, stacked on this). Gated on BE-17276 via the readers (Comfy-Org#18874), on FE-2894 (Comfy-Org#18715), FE-2895 (Comfy-Org#18716) and C5 cloud#10555. Base is the readers branch; the diff also shows the FE-2894/FE-2895 merges. This PR's own change: 9 files, 299 non-test lines. ## Why billing-web signs in on its own Firebase login and mints a workspace token. With `unified_web_session` on, a visitor already signed in on Cloud should be recognised from the shared session without starting Firebase or signing in again. This part adds the one decision point and the session-backed identity and sign-in. Part 2 adds the workspace scope and the credentialed billing transport. ## How - **`billingWebAuth.ts`: one decision per page load.** It chooses `session-client` (today's path) or `web-session`. - The router guard starts the decision but never waits for it. Until the decision lands, every phase reads `pending`, which is exactly what main shows while Firebase hasn't answered. - A probe that is absent or false settles it as soon as the `/api/features` document arrives. That is the same document Firebase's config comes from, so Firebase starts at the same moment as on main. - The session path gets **800 ms**. After that, the page load stays on today's path, and a late `true` is ignored. - **`unifiedBillingSession.ts`** boots the FE-2894 identity (`@comfyorg/account-core/webSessionIdentity`). Firebase is only a lazy RememberedLogin proof, consulted after the server says there is no session. - **Sign-in controller port:** `SignInView` gets a port that follows the decision. If a Cloud session is found in time, the page is left the same way a restored login leaves it. - The router, `App` and `SignInView` are rewired to the decision point. Entry-workspace rebinding still mints on today's path only. ### Decisions for review 1. **Flag-on first paint.** A visitor with a live Cloud session briefly sees main's pre-config sign-in screen: disabled buttons and the "unavailable" notice. It lasts until the decision lands, at most 800 ms, and then the page leaves it. This is the price of never delaying the flag-off path. 2. **A different remembered Firebase user is not signed out.** While the session is live, nothing on billing-web asks Firebase for a token or mints from `/auth/token`. Identity, scope and every billing request come only from the session cookie. So a different remembered user has no path to any request. It is consulted only after the server reports no session, and a restore goes through the server's silent-restore rules. ## Flag-off parity `billingWebAuth.flagOff.test.ts` renders `App` with the real router: - **Features read hangs:** the page is on `/sign-in`, the notice is shown, and Firebase is not initialised. Same as main. - **Credentialed flag read hangs:** Firebase is not started at 799 ms and is started at 800 ms. A late `true` sends no `/api/auth/session` and doesn't re-initialise Firebase. - **Probe false:** Firebase is initialised well before the cap. The request tables are identical to main with the probe absent or false, and `src/platform/auth/webSessionFlagOff.test.ts` passes. Timing mutations each go red: no cap, cap at 5000 ms, the guard awaits the decision, a late `true` swaps the mode, a false probe waits for the cap. ## AS IS / TO BE | | AS IS | TO BE | | --- | --- | --- | | Flag off | Firebase sign-in | unchanged, same first render and notice | | Flag on, live Cloud session | Firebase sign-in form | recognised from the session in ≤ 800 ms, no Firebase | Screenshots will be added by editing this description once testcloud serves the probe. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2898 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | Comfy-Org#18878, do not merge | | FE-2896 | website header | FE-2891 readers, FE-2894, C11 | Comfy-Org#18877, do not merge | | FE-2899 | website credits | FE-2896, FE-2895, C5 | in progress | | **FE-2898 (this PR)** | billing-web on the session (A identity, B transport) | FE-2891 readers, FE-2894, FE-2895, C5 | A + B, do not merge | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2898 thisPr ``` - Blocked by: FE-2891 readers Comfy-Org#18874, FE-2894 Comfy-Org#18715, FE-2895 Comfy-Org#18716, C5 cloud#10555 - Unblocks: M2 billing-web checkout on the shared session --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ession (Comfy-Org#18877) > **Do not merge.** Gated on BE-17276 (`web_session_probe`) through the readers in Comfy-Org#18874, and on the FE-2894 identity in Comfy-Org#18715. Base is the readers branch; the diff also shows the FE-2894 merge. This PR's own change is 5 files: 154 non-test lines and 390 test lines. ## Why On the website, a visitor who is already signed in to Cloud through the shared web session should see that account in the header, without starting Firebase. Today the header always loads the Firebase account island. FE-2896 lets the header take the account from the web session when `unified_web_session` is on for that visitor, and changes nothing when it is off. ## How - **`resolveWorkshopAccountSource()`** (`apps/website/src/config/workshop-web-session-identity.ts`) settles once per page load to `'session'` or `'firebase'`. - The probe (Comfy-Org#18874) is absent or false, or the per-user flag is off: `'firebase'` at once. No session read is sent. - The flag is on: the FE-2894 identity boots. A live session gives `'session'` and a signed-out answer gives `'firebase'`. - **Cap: at most 800 ms.** If the cap fires first, the answer is `'firebase'` for the page load and the identity is disposed. A late answer never swaps a mounted header, and a session read is never sent after the cap. - **`HeaderMain.vue`**: the async loaders for `HeaderAccount` and `BuyCreditsDialog` wait for the source. On `'session'` they mount `HeaderSessionAccount` (an initials chip labelled with the email) and an empty dialog, so no Firebase island starts. - **RememberedLogin port**: the proof comes from Firebase only if Firebase is already loaded. The website never force-loads Firebase to build a proof. - **User id**: the Comfy user id is the Firebase uid today (`token.UID` in cloud `firebase_auth.go`). This holds until Phase 2.5. ### Kept out of this PR - **Session-mode header**: no menu, sign-out, credits or workspace switcher. Sign-out is FE-2897. Credits (FE-2899) and the workspace come next. Asking to buy credits in session mode does nothing until FE-2899. - **Playground and `/login`**: these still start Firebase. A stale Firebase login for a different user is signed out only if Firebase was already loaded when the session answered. - **SDK follow-up**: `readWebSession` sends no `X-Comfy-Client`. If C5 requires it on `/api/auth/session`, the fix belongs in account-core. ### /models/ script budget `e2e/models-performance.spec.ts` caps the JavaScript that `/models/` loads. This PR raises that ceiling from 1,810,000 to 1,815,000 bytes. - main measures 1,808,088 bytes, 1.9 KB under the old ceiling. - The header's once-per-page-load session decision ships even with the flag off: the probe read, the flag read and the 800 ms cap. - Two changes already moved code behind the flag: - the session boot now loads lazily; - `COMFY_CLIENT`, which inlines the package manifest, now loads only for the credentialed read. - With both, this branch measures 1,811,181 bytes in CI (an extra ~3 KB, down from ~8 KB). - The catalogue-only delta check (900,000) is unchanged. ## Flag-off parity - Probe absent or false: the same islands mount, and no `/api/auth/session` request is sent (`HeaderMain.webSession.test.ts`). - The header's only new wait is the probe read. It ends when the probe answers, and it never lasts past 800 ms. - `src/platform/auth/webSessionFlagOff.test.ts` passes. The cloud app is not touched. - Mutation checks: 10 mutations, all red. They include: the cap never decides, the session boots after the cap, the flag-off path waits for the cap, the header is ungated, and the boot ignores the flag. ## AS IS / TO BE | | AS IS | TO BE | | --- | --- | --- | | Flag off | Firebase header | Firebase header, unchanged | | Flag on, live session | Firebase header | Session chip (screenshot to follow once testcloud serves the probe) | Screenshots will be added by editing this description. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2896 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | next | | **FE-2896 (this PR)** / 2899 / 2898 | website header (this PR), website credits, billing-web | FE-2891 readers, FE-2894/2895, C5, C11 | next | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2896 thisPr ``` - Blocked by: FE-2891 readers Comfy-Org#18874 (BE-17276 probe), FE-2894 Comfy-Org#18715, BE-17063 on testcloud - Unblocks: FE-2899 website credits (next, stacked on this branch) --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…e shared web session (2/2) (Comfy-Org#18881) > **Do not merge.** Part 2 of 2 for FE-2898, stacked on part 1 Comfy-Org#18880 (identity and sign-in gating). Gated on C5 cloud#10555. 11 files, 224 non-test lines. ## Why Part 1 recognises a Cloud session on billing-web. This part gives that session a workspace scope and sends billing requests on the cookie, so the flag-on path never mints a workspace token. ## How - **Workspace lookup:** `GET /workspaces/current` is authorized with `authorize()` from FE-2895. - The request uses `credentials: 'include'`, `X-Comfy-Client`, and `X-Comfy-Workspace-ID` from the entry link's bound workspace. Absent means personal. - The phase is `authenticated` only once that lookup succeeds. - **Refusals from C5:** - `workspace_access_denied` → `ACCESS_DENIED` - `workspace_id_invalid` → `WORKSPACE_NOT_FOUND` - 401 → `NOT_AUTHENTICATED` - Anything else maps to the existing `TOKEN_EXCHANGE_FAILED`. - **Billing client:** `createWebSessionBillingClient` uses `createCredentialedBillingTransport` (`@comfyorg/account-core/billing`, opt-in `webSession` from Comfy-Org#18716). Its `getWorkspaceToken` rejects: billing-web never mints on this path. - **UI:** `BillingShell`, `HostedSurface` and `useBilledWorkspace` read the scope from the decision point. On a refusal, `SignInView` shows the refusal copy. ### Decisions for review 1. **A refused workspace hides the sign-in form.** The visitor is signed in, but the entry names a workspace they can't use. Signing in again wouldn't fix that, so the page shows only the refusal. 2. **The role defaults to `member`** when `/workspaces/current` omits it. That is the least privilege; the server still enforces every write. 3. **The transport may re-read the session.** When the credentialed transport has a request refused, it re-reads the session (`readWebSession` with `expectedUserId`) before failing. That can add a `GET /api/auth/session` on a refusal. ## Flag-off parity The flag-off path doesn't reach any of this: the mode is `session-client` and the existing token client is unchanged. The part 1 flag-off pin, including its timing tests, passes here unchanged, and so does `src/platform/auth/webSessionFlagOff.test.ts`. The flag-on tests (SS1, SS6, SO4) cover: - the exact headers and credentials on the workspace lookup and on billing requests; - no `Authorization` header and no `/api/auth/token`; - refusal copy per code. ## AS IS / TO BE | Flag on | AS IS | TO BE | | --- | --- | --- | | Billing requests | `Authorization: Bearer <workspace token>` | cookie + `X-Comfy-Workspace-ID`, no token | | Entry workspace refused | sign-in form | refusal copy, no form | Screenshots will be added by editing this description once testcloud serves C5. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2898 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | Comfy-Org#18878, do not merge | | FE-2896 | website header | FE-2891 readers, FE-2894, C11 | Comfy-Org#18877, do not merge | | FE-2899 | website credits | FE-2896, FE-2895, C5 | in progress | | **FE-2898 (this PR: B)** | billing-web on the session (A identity, B transport) | FE-2891 readers, FE-2894, FE-2895, C5 | A + B, do not merge | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2898 thisPr ``` - Blocked by: FE-2891 readers Comfy-Org#18874, FE-2894 Comfy-Org#18715, FE-2895 Comfy-Org#18716, C5 cloud#10555 - Unblocks: M2 billing-web checkout on the shared session --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…fy-Org#18882) > **Do not merge.** Stacked on FE-2896 (Comfy-Org#18877) with the FE-2895 (Comfy-Org#18716) merge, and gated on C5 cloud#10555. The diff also shows the fe-2895 merge. This PR's own change is 7 files, about 160 non-test lines. ## Why In FE-2896's session mode, the website header shows the account but no credit balance, because the balance read needs a minted workspace token. This is the first consumer of `authorize()` on the session. It proves the cookie path end to end on a read, with no workspace token in page memory. ## How - **`workshop-session-balance.ts`**: `readSessionBalance(session, fetchImpl)` sends `GET /api/billing/balance` through `createRequestAuthorizer(...)` → `authorize({ kind: 'session', session }, { target: 'ingest', method: 'GET' })`. - The request carries `credentials: 'include'` and `X-Comfy-Client`. It has no `Authorization` and no workspace header, which means personal. - The authorizer's `getWorkspaceToken` always rejects, so this path can never mint a token. - The result is one of `ok`, `unavailable`, `session_ended` or `unknown`. - **`useWorkshopSessionBalance`**: one shared state per page. It reads once, again on window focus, and never again after a 401. The header mounts twice (desktop and mobile) but sends one request. - **`HeaderSessionAccount.vue`** shows a credits chip, styled like the Firebase one, only when the state is `ok`. - **The decision is FE-2896's.** `useWorkshopWebSession()` keeps the whole `WebSession`, and this module is loaded only when `resolveWorkshopAccountSource()` answered `'session'`. There is no new flag read. - **`X-Comfy-Client` is converged:** `webSessionFlag` (readers, Comfy-Org#18874) now imports `COMFY_CLIENT` from requestAuth instead of keeping its own copy. - The Firebase balance reader (`workshop-balance.ts`) is untouched. The session module keeps its own short copy of the balance-body parse, so the Firebase path's code and requests are identical to main. ### Decisions for review 1. **Workspace.** Session mode reads the personal workspace. The session header has no workspace picker, and the Firebase selection lives in a minted token that doesn't exist here. Nothing is derived from other server data. 2. **Refusals.** C5 403s (`origin_not_allowed`, `workspace_access_denied`, `csrf_invalid`, `cross_site_request`), a 400 `workspace_id_invalid`, 5xx, and network or body errors all hide the balance. It is read again on the next focus. A 401 hides it and stops reading. Neither case signs anyone out; sign-out stays with the identity module. 3. **Out of scope:** - Buying credits and the top-up watch: `BuyCreditsDialog` is still empty in session mode. - Workspace switching. - Refreshing the balance after a run. - The balance on `ModelDetail`, which still calls `useWorkshopCredits` and can start Firebase session state in session mode. That is a follow-up, and it also touches FE-2896's "no Firebase on comfy.org" criterion. ## Flag-off parity - The request-table test (`it.for`) pins both sources: - Firebase: exactly `{ authorization: 'Bearer …' }`, with no `credentials`. - Session: exactly `{ x-comfy-client }`, with `credentials: 'include'`, one request and no workspace header. - The HeaderMain request list now records `Authorization` and `X-Comfy-Client` on every request. The flag-off rows are unchanged. The live-session row adds only the balance read, with no `Authorization` and no `/api/auth/token`. - `src/platform/auth/webSessionFlagOff.test.ts` passes. - Mutations, each red: - always use the session header; - drop `credentials`; - add `Authorization`; - mint a token; - send `X-Comfy-Workspace-ID`; - treat a 403 as a 401; - keep reading after a 401. ## End-to-end coverage No `apps/website/e2e/` spec is added. The credits balance only renders when `unified_web_session` is on and a real `__Host-comfy_session` cookie from Cloud ingest is present. The website Playwright suite serves a static build with no Cloud backend and blocks cross-origin requests, so it cannot hold that session. The cross-origin session flow is covered by the `playwright.session.config.ts` harness (Comfy-Org#18718), which runs against staging. The flag-off path, which is what every visitor sees today, is unchanged, and the existing website e2e suite covers it. The balance behaviour itself (read on sign-in, clear on sign-out, stale reads ignored across a same-user sign-out and sign-in) is pinned in `workshop-session-balance.test.ts`. ## AS IS / TO BE | Session mode | AS IS | TO BE | | --- | --- | --- | | Header | account chip, no balance | account chip + credits chip from the cookie read | | Flag off | Firebase header + balance | unchanged | Screenshots will be added by editing this description once testcloud serves C5. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2899 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | Comfy-Org#18878, do not merge | | FE-2896 | website header | FE-2891 readers, FE-2894, C11 | Comfy-Org#18877, do not merge | | **FE-2899 (this PR)** | website credits | FE-2896, FE-2895, C5 | this PR, do not merge | | FE-2898 | billing-web on the session (A identity, B transport) | FE-2891 readers, FE-2894, FE-2895, C5 | Comfy-Org#18880 + Comfy-Org#18881, do not merge | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2899 thisPr ``` - Blocked by: FE-2896 Comfy-Org#18877, FE-2895 Comfy-Org#18716, C5 cloud#10555 - Unblocks: Session-mode buy credits and workspace picker (follow-up) --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…itch without a mint (Comfy-Org#18875) > **Stacked on Comfy-Org#18871 (FE-2903) and includes a merge of Comfy-Org#18716 (FE-2895, `authorize()`). Do not merge** until those merge and C5 (BE-17066, cloud#10555) is on testcloud. My change is the last commit (`e7085c16e7`); the diff also shows the FE-2895 merge until Comfy-Org#18716 lands. ## Why With `unified_web_session` on, the cloud app should call ingest on the session cookie instead of a token (TDD §9, §12, F4). That means the headers come from `authorize()`, switching workspace changes a header instead of minting a token, and the one automatic retry is tied to the user and workspace the request started for. With the flag off, nothing may change. ## How - **One decision point.** `src/platform/auth/session/webSessionFetch.ts` is a registration slot the cloud session store (FE-2903) fills in `start()` when the session is on, and clears on dispose. - `api.ts`, `workspaceAuthStore` and `authStore` check it synchronously. When the slot is empty the code runs exactly as today. - A slot rather than importing the store avoids two import cycles that fallow flagged. - **`api.fetchApi`.** When the session is on and signed in, the request goes through `fetchOnWebSession`, which takes its headers from `authorize()`: - `X-Comfy-Client` on every request. - `X-Comfy-Workspace-ID` only for a team workspace (absent means personal). - `X-CSRF-Token` on POST, PUT, PATCH and DELETE. - `credentials: 'include'` and no `Authorization` header. Otherwise the unchanged token path runs; it is moved verbatim into `addCloudAuthHeader` to keep `fetchApi` under fallow's complexity limit. - **Retries.** - `csrf_invalid`: one re-read of the session, pinned to the same user, then one retry in the same workspace, only if the user and session epoch are unchanged. Otherwise the original 403 is returned. Later requests reuse the fresh token, and a streaming body is never replayed. - `workspace_access_denied`: the selection is dropped through the existing revoked-workspace path, and the request is never replayed in another workspace. - **Workspace switch.** With the session on, the switch calls `GET /api/workspaces/current` with the workspace header and stores id, name, type and role. It mints no token. With no signed-in session it falls back to today's switch. - **`authStore.getAuthHeader`.** With the session on, it returns the user's Firebase or API-key header instead of minting a workspace token, so the router's check on every navigation no longer mints. - **Not in this PR:** - Other ingest callers: `workspaceApi` (axios), remote widgets and agent consent stay on today's tokens. - With the flag on, remote widgets resolve to the personal workspace. This is a flag-on-only gap; moving the axios clients onto `authorize()` is a proposed follow-up. - WebSocket and media URLs are FE-2905. The comfy-api session mint is FE-2900. - `permissions` are not stored, since nothing reads them yet. ## AS IS / TO BE Flag off: `src/platform/auth/webSessionFlagOff.test.ts` is byte-identical to the base and passes. The full `src` and account-core vitest run is 1620 files, 23152 tests. Flag on: `webSessionFlagOn.test.ts` gains five cases. - **Boot into a remembered team workspace.** The GET carries the client and workspace headers with `include` and no `Authorization`. The POST adds CSRF. `getAuthHeader` returns the Firebase header. Switching to personal changes only the header, and `/api/auth/token` is never called. - **`csrf_invalid`, same user.** One re-read, then one retry, and later requests use the fresh token. - **`csrf_invalid` after the user changed.** The request is abandoned. - **`workspace_access_denied`.** The selection is dropped, and the request is not replayed. - **A switch into a refused workspace** throws. Eleven mutations were each reverted with the full suites rerun, and all went red: | Mutation | | --- | | no CSRF retry | | the re-read ignores the user | | denied workspace not dropped | | workspace header sent for the personal workspace | | `fetchApi` ignores the session | | request method dropped | | fresh CSRF token not reused | | the switch mints a token | | `getAuthHeader` mints a token | | session never registered | | denied request replayed in another workspace | Checks: typecheck, eslint, oxlint, oxfmt and knip are clean, and fallow reports 0 new findings against the FE-2903 branch. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b (sections 9, 12, F4) - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2904 - Contract: Comfy-Org/cloud#10555 (C5) ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | **FE-2904 (this PR)** | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | FE-2905 | socket + media carry workspace | FE-2904, C6, C7 | next | | FE-2896 / 2899 / 2898 | website header, website credits, billing-web | FE-2891 readers, FE-2894/2895, C5, C11 | next | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2904 thisPr ``` - Blocked by: Comfy-Org#18871 (FE-2903) and Comfy-Org#18716 (FE-2895); C5 cloud#10555 on testcloud. - Unblocks: FE-2905 (socket and media), FE-2906 rows E2E-03/06 and FS-13/14. --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
…space (Comfy-Org#18878) > **Do not merge.** Stacked on FE-2904 (Comfy-Org#18875) and gated on C6 cloud#10583 (+Comfy-Org#10699) and C7 cloud#10584 (+Comfy-Org#10698). The diff is 6 files: about 125 non-test lines. ## Why With `unified_web_session` on, API requests already travel on the session cookie with `X-Comfy-Workspace-ID` (FE-2904). Two surfaces can't carry that header: - the WebSocket handshake; - media URLs loaded by `<img>` / `<video>` tags. Without this PR they would still need a minted token in the URL, and they would read the personal workspace in a team. C6 and C7 let both accept the cookie and a `?workspace_id=` query parameter instead. ## How Everything hangs off the single registration slot `webSessionRequests()` from FE-2904. There is no second flag read. - **`WebSessionRequests.workspaceId()`** returns the team workspace id only while the tab is signed in on the session. Otherwise it returns nothing, which means personal. - **Socket (`api.ts`):** the auth params come from a private `addSocketAuth(params)`. - Signed in on the session: no `token`. `workspace_id` is set for a team and left out for personal. - No session: today's token code, moved as is. - With the flag on, no session and no token, no socket opens. - **Reconnect:** - `api.reconnectSocket()` re-handshakes and keeps the client id. `resetSocket()` still clears the ids, and both share `replaceSocket()`. - `cloudWebSessionStore` watches the signed-in user and the team workspace, and reconnects on any change while signed in. There is no token mint. - **Media URLs:** `apiURL()` passes the media routes through `scopeMediaRoute`, which adds `workspace_id` for a team and never duplicates it. The routes are `/view`, `/viewvideo`, `/vhs/viewvideo`, `/vhs/viewaudio` and `/assets/:id/content`, with or without an `/api` prefix. ### Decisions for review 1. **Flag on and signed out: no socket.** Today a tokenless `/ws` keeps reopening. One gap is covered only by a reload: the flag is on, the session was never created, and Firebase signs in again in the same page. 2. **A removed team member's socket retries every 300 ms.** It stops when the next API call gets `workspace_access_denied`, which drops the workspace and reconnects in personal. That matches today's token-socket loop, and no probe request is added. 3. **A Cloud workspace switch may open one extra short-lived socket** before the reload. The newer socket wins and the older one is closed. 4. **Not scoped:** literal `api/view` strings that don't go through `apiURL` (`useWidgetSelectItems.getMediaUrl`, `LoaderManager`, `BackgroundImageUpload`), and server-supplied `preview_url`s. These fall back to C7's cross-workspace lookup. Moving them onto `apiURL` would change the flag-off output, so it is left for a follow-up. 5. **Header or query, never both.** `fetchApi` names the workspace only in `X-Comfy-Workspace-ID`, and its URL skips `scopeMediaRoute`. The query is only for URLs that tags load without headers. A test pins that a session media fetch sends the header and a bare URL, and it goes red if `fetchApi` goes back to the scoped URL. ## Flag-off parity - With the slot empty, `apiURL` returns the route unchanged, and the socket runs today's token code. `addSocketAuth` returns true, as before. - The shared harness `src/platform/auth/webSessionFlagOff.test.ts` is extended, not loosened. It now also pins `/api/viewvideo…`, `/api/vhs/viewaudio…` and `/api/assets/:id/content`, because `apiURL` is on their path. - Mutation checks, all red: drop `workspace_id` from the socket, keep the token on the session, open a socket while signed out, remove the workspace reconnect, leave media unscoped. ## AS IS / TO BE | Flag on, team workspace | AS IS | TO BE | | --- | --- | --- | | Socket | `/ws?token=<minted>` | `/ws?workspace_id=<team>` on the cookie | | Media URL | `/api/view?filename=…` (personal) | `/api/view?filename=…&workspace_id=<team>` | | Flag off | unchanged | unchanged | Network screenshots will be added by editing this description once testcloud serves C6/C7. ## Links - TDD: https://app.notion.com/p/3de6d73d365081d7a4c8f808c0a0384b - Action items: https://app.notion.com/p/3e56d73d3650812d962decc97fbd9ea3 - Linear: https://linear.app/comfyorg/issue/FE-2905 ## Where this PR sits in the plan | Ticket | Scope | Blocked by | State | | --- | --- | --- | --- | | FE-2891 | flag (cloud) + website/billing-web readers | C11 cloud#10689 + BE-17276 probe (readers) | Comfy-Org#18708 merged; readers Comfy-Org#18874, do not merge | | FE-2892 | web session client (+ revoke-all follow-up) | C2a cloud#10589 for revoke-all | Comfy-Org#18710 merged; revoke-all Comfy-Org#18869, do not merge | | FE-2893 | ADR | none | Comfy-Org#18707 merged | | FE-2894 | identity + boot rules | BE-17063 on testcloud | Comfy-Org#18715, do not merge | | FE-2895 | `authorize()` | C5 cloud#10555 | Comfy-Org#18716, do not merge | | FE-2897 | lifecycle, heartbeat | FE-2894, C1 | Comfy-Org#18719, do not merge | | FE-2900 | lazy token mint from the session | FE-2895, C8 cloud#10585 | Comfy-Org#18870, do not merge | | FE-2901 | non-web clients stay on tokens | — | Comfy-Org#18711 | | FE-2903 | cloud app joins the lifecycle | FE-2897 | Comfy-Org#18871, do not merge | | FE-2904 | cloud API client on `authorize()` | FE-2903, FE-2895, C5 | Comfy-Org#18875, do not merge | | **FE-2905 (this PR)** | socket + media carry workspace | FE-2904, C6, C7 | this PR, do not merge | | FE-2896 | website header | FE-2891 readers, FE-2894, C11 | Comfy-Org#18877, do not merge | | FE-2899 / 2898 | website credits, billing-web | FE-2896, FE-2895, C5 | next | | FE-2906 | cross-origin E2E harness | — | Comfy-Org#18718 (harness only) | | FE-2902 / 2907 / 2908 | platform, rollout, cleanup | other repo / ops / after ramp | not started | ```mermaid flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2905 thisPr ``` - Blocked by: FE-2904 Comfy-Org#18875, C6 cloud#10583 (+Comfy-Org#10699), C7 cloud#10584 (+Comfy-Org#10698) - Unblocks: FE-2907 rollout: the cloud app's socket and media are covered --------- Co-authored-by: mattmillerai <7741082+mattmillerai@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
Why
The website and billing-web learn a session visitor's
unified_web_sessiononly through C11 (cloud#10689). That meansGET /api/featureswithcredentials: 'include'andX-Comfy-Client, sent before the site knows the flag. We agreed to gate that request on a global runtime switch served to anonymous callers,web_session_probe(BE-17276, Maanil). Then the request and its CORS preflight don't exist until rollout, and turning them off needs no deploy. This PR adds the readers the website header (FE-2896), website credits (FE-2899) and billing-web (FE-2898) will use.How
@comfyorg/account-core/webSessionFlag.readWebSessionProbe: a plain anonymousGET /api/featureswith no credentials and no custom headers, so there is no preflight. It is on only forweb_session_probe === true.resolveUnifiedWebSession({ probe, … }): sends the credentialed read (credentials: 'include',cache: 'no-store',X-Comfy-Client) only when the probe resolvestrue. It returns on only forunified_web_session === true.web_session_probefrom the anonymous/api/featuresit already fetches for the Firebase config.fetchCloudFeatures/resolveWebSessionProbein@comfyorg/account-core/firebaseshare that memoized request; the timeout must stay 4000 ms to share it.readBillingWebUnifiedWebSession()is cached per page load.workshop-features.ts. So its probe is one plain anonymous GET.readUnifiedWebSessionEnabled(); until then the website is unchanged.X-Comfy-Client.COMFY_CLIENTis not on main (it lives in FE-2895 feat(account-core): requestAuth authorize() for cookie requests #18716), so the value is defined once in this module with the same shape (name/version), and a note says it converges with FE-2895 feat(account-core): requestAuth authorize() for cookie requests #18716.src/platform/auth/webSessionFlagOff.test.tspasses.AS IS / TO BE
No UI yet; the evidence is the request tables pinned with
it.for."true"These rows describe what happens once a consumer calls a reader; nothing calls one in this PR. The
"true"string row is covered in the account-core tests. A second call sends nothing new.Mutations (each reverted, full suites rerun):
configSourceChecks: vitest passes for account-core 1101, billing-web 198, website 8924 and the flag-off harness 4. Typecheck, oxlint, eslint, oxfmt, knip, fallow (no issues in 12 files) and
checkPublishableare all clean.For review:
X-Comfy-Clientvalue or only that the header is present? The value carries the package version.Links
Where this PR sits in the plan
authorize()authorize()flowchart LR subgraph BE["BE · cloud ingest and infra"] C0["BE-17071 C0 preview CORS gate"] C1["BE-17061 C1 sessions table + revocable cookie"] C3["BE-17063 C3 GET /session, trusted origins, flag"] C4["BE-17062 C4 shared workspace resolution"] C5["BE-17066 C5 cookie on API: CSRF, Origin, workspace header"] C2["BE-17064 C2 revoke-all, purge, caps"] C6["BE-17067 C6 WebSocket on session"] C7["BE-17068 C7 scoped media"] C8["BE-17069 C8 token mint from session"] C9["BE-17065 C9 Redis cache + load test"] C10["BE-17072 C10 prod config, cleanup"] C11["C11 flag before sign-in (OQ17)"] B135["BE-17135 serve unified_web_session (server AND)"] I2["BE-17070 I2 edge limit, log + DNS audit"] end subgraph SDK["FE · account-core"] F2891["FE-2891 flag"] F2892["FE-2892 web session client"] F2894["FE-2894 identity + boot rules"] F2897["FE-2897 lifecycle, heartbeat"] F2895["FE-2895 authorize()"] F2900["FE-2900 lazy token mint"] F2901["FE-2901 non-web stay on tokens"] end subgraph APPS["FE · apps"] F2896["FE-2896 website header"] F2903["FE-2903 cloud lifecycle"] F2899["FE-2899 website credits"] F2904["FE-2904 cloud API client"] F2905["FE-2905 socket + media"] F2898["FE-2898 billing-web joins session"] F2902["FE-2902 platform"] end subgraph QA["QA · rollout · docs"] F2906["FE-2906 cross-origin E2E"] F2893["FE-2893 ADR + docs"] F2907["FE-2907 ramp + rollback"] F2908["FE-2908 cleanup"] end C0 --> C1 --> C3 --> C5 C3 --> C11 --> F2891 B135 --> F2891 C4 --> C5 C1 --> C2 C1 --> C9 C5 --> C6 & C7 & C8 C3 --> F2892 C1 --> F2892 F2891 --> F2894 C3 --> F2894 F2892 --> F2894 --> F2896 F2894 --> F2897 --> F2903 C1 --> F2897 F2892 --> F2895 C5 --> F2895 F2895 --> F2899 & F2904 & F2900 & F2901 & F2902 C5 --> F2899 & F2904 F2903 --> F2904 --> F2905 C6 --> F2905 C7 --> F2905 C8 --> F2900 F2894 --> F2898 F2895 --> F2898 C3 --> F2898 C5 --> F2898 F2903 & F2904 & F2905 & F2898 --> F2906 C3 & C2 --> F2906 F2906 --> F2907 C9 & C10 & I2 --> F2907 F2907 --> F2908 C10 --> F2908 classDef thisPr fill:#ffe08a,stroke:#b8860b,stroke-width:4px,color:#000 class F2891 thisPr