Repository navigation
[backport cloud/1.58] fix: harden workflow load against null initial state (#21326) - #22397
Conversation
…rences (#21326) <!-- claude-slack-attribution --> _Requested via [Slack thread](https://comfy-organization.slack.com/archives/C09KFK2ABB8/p1792312102906099?thread_ts=1792312102.906099&cid=C09KFK2ABB8)_ **Before:** if a workflow became the active one without its change tracker ever loading, activating it threw `TypeError: Cannot read properties of null (reading 'extra')` (and a sibling `reading 'nodes'` of null in `ChangeTracker.graphEqual`). Nothing recorded which path got it into that state, and a save from that state could write `null` over the stored workflow file. **After:** the same situation is tolerated at each point that reads the missing state, an unloaded workflow is loaded instead of being handed back as loaded, a save from an unloaded workflow is refused, and every guard hit is reported with enough structure to identify the real trigger on the next occurrence. This is hardening plus instrumentation, not a verified fix. A production alert shows `Cannot read properties of null (reading 'extra')` in `activateLoadedWorkflow` and a sibling `reading 'nodes'` of null in `ChangeTracker.graphEqual`, but there was no usable stack, and nothing has reproduced it locally. The root cause below is a hypothesis. Hypothesis: `ComfyWorkflow.initialState` is `changeTracker?.initialState ?? null`, so it is null whenever the tracker is not loaded. That can happen when: - `workflowStore.openWorkflow` returns early because `isActive(workflow)` is true. `isActive` compares by path, so a same-path instance that never loaded its tracker is returned as if it were loaded. - Stored content parses to JSON `null` (`load()` builds a tracker around it). (`initialState`, `activeState?.id`, `changeTracker?.deactivate()` in `beforeLoadNewGraph`), turning the missing state into a hard throw. What changes: - `activateLoadedWorkflow`: tolerates a missing `initialState` (falls back to the mode of the load being processed) and a missing tracker (skips the reset/restore instead of throwing). - `beforeLoadNewGraph`: tolerates an active workflow with no tracker. - `ChangeTracker.graphEqual`: returns `false` (not equal) when either side is missing. `updateModified` leaves `isModified` untouched when the tracker has no initial state. - `ComfyWorkflow.load()`: rejects stored content that is not a JSON object (null, number, string, array) instead of building a tracker around it. - `ComfyWorkflow.save()` / `saveAs()`: refuse (throw, before touching content or storage) when there is no active state, so `null` is never persisted. Throwing is deliberate here: returning quietly would let callers mark the workflow clean without saving. - `workflowStore.openWorkflow`: an active workflow that is not loaded is now loaded instead of returned as loaded. - Instrumentation: each guard calls `assert(false, message, context)` (the same reporting path as the inactive-tracker assertion), through a small shared helper in `comfyWorkflow.ts`, `reportWorkflowStateAnomaly`. The message is static per call site. The context carries `method`, `isLoaded`, `hasChangeTracker`, `hasInitialState`, `hasActiveState`, `isPersisted`, `isTemporary`, `originalContentKind` (`unavailable | empty | null | object | other | unparseable`), and `isActive` where known. No names, paths or content are sent. Reports are deduplicated per call site and workflow. Known tradeoffs: - `assert` throws in DEV builds, so in dev these guards surface the problem immediately instead of recovering, same as the existing inactive-tracker assertion. Production reports and recovers. - The unloaded-active fix loads the workflow from storage, so in the (unconfirmed) same-path-different-instance case the loaded copy replaces the active one. `activateLoadedWorkflow` immediately resets the tracker with the graph just loaded onto the canvas, so the canvas state is what is kept. - Tests: new unit tests for each guard and for the reporting call (context shape, no path leakage, deduplication) in `workflowStore.test.ts`, `workflowService.test.ts`, `changeTracker.test.ts` and `comfyWorkflow.test.ts`. With the source changes stashed, 16 of the new tests fail. - Commands run locally: `pnpm exec vitest run src/platform/workflow src/scripts/changeTracker.test.ts` (all pass), `pnpm typecheck` (clean), oxlint (including type-aware), eslint and oxfmt on the changed files (clean), and the pre-commit hook. - Not run: the full unit suite, Playwright browser tests, manual reproduction in the app. - After release: watch for the new assertion messages (`Workflow content is not a JSON object`, `Workflow saved without an active state`, `openWorkflow called on an active workflow that is not loaded`, `Activated workflow has no initial state`, `Activated workflow has no change tracker`, `Active workflow has no change tracker before loading a new graph`, `ChangeTracker has no initial state`, `ChangeTracker.graphEqual() called with a missing state`) and their `method` and `originalContentKind` context. Which one fires first, and with which flags, identifies the trigger. --- _Generated by [Claude Code](https://claude.ai/code/session_01QBengj382AMebTiwLDtHtr)_ - The summary above calls the cause a hypothesis. It is now confirmed: the stored workflow file is literally `null`. Details and production evidence: [comment](#21326 (comment)). - `aaec0a4` adds a black-box spec, `browser_tests/tests/workflowNullStoredContent.spec.ts`, which fails on the parent and passes here. `ad78d13` adds the fix for the verified writer: closing a tab now clears the modified mark. - All required checks pass at head `a3249478867b383f3b04e5ca6d902bf868b307cb`, which already contains current `main`. The new spec ran and passed in CI. The "Not run" line above is out of date. <details><summary>Full context for agent readers</summary> - `a324947` merges `main` and changes nothing else. Its tree equals `git merge-tree` of `ad78d13` and `main@606fbc6`. - Checks at `a324947`: `test`, `lint-and-format`, `e2e-status`, `website-e2e` and `cla-assistant` succeeded. Playwright: 2996 passed, 0 failed. Unit: 8 of 8 shards passed. `playwright-video-new-tests` ran the new spec: 1 passed in 17.4 s. - The 3 flaky tests are `agentReplyDrafts`, `modelImportProgressDialog` and `dynamicGroup`. None of them touches this diff. - The perf report shows FPS misses in Vue-renderer, extension-draw and combo scenarios. These checks are not required. The diff touches no rendering code; the only change on the canvas path is one null check in `updateModified`. - Codecov flags 3 lines in `comfyWorkflow.ts` without coverage. `codecov/patch` still passes. - Fail-closed behavior is unchanged. Stored content that is not a JSON object is refused on load, and a save with no active state is refused, so a stored `null` is never overwritten and never silently replaced. - Still open: the activation unwind tracked in #16960 (see the linked comment). </details> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> (cherry picked from commit b31319c)
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords: 2
Please check the settings in the CodeRabbit UI or the
|
📦 Bundle Size
⚡ Performance Report
Scenario timings
Absolute values
Raw data{
"timestamp": "2026-10-30T19:28:47.666Z",
"gitSha": "4b9d76e1b534cecf60fa0f375c42c8f579803823",
"branch": "backport-21326-to-cloud-1.58",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2023.257000000001,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.7509999999999994,
"layouts": 9,
"layoutDurationMs": 2.396,
"taskDurationMs": 384.29799999999994,
"heapDeltaBytes": 4216264,
"heapUsedBytes": 92063708,
"domNodes": -180,
"jsHeapTotalBytes": -2818048,
"scriptDurationMs": 9.091,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2007.739000000015,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.1180000000000003,
"layouts": 10,
"layoutDurationMs": 2.012,
"taskDurationMs": 276.041,
"heapDeltaBytes": -884576,
"heapUsedBytes": 87468956,
"domNodes": -200,
"jsHeapTotalBytes": -3342336,
"scriptDurationMs": 6.159,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760334,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1677.6990000000183,
"styleRecalcs": 72,
"styleRecalcDurationMs": 11.828999999999999,
"layouts": 10,
"layoutDurationMs": 2.4450000000000003,
"taskDurationMs": 533.9549999999999,
"heapDeltaBytes": 966116,
"heapUsedBytes": 105079048,
"domNodes": 0,
"jsHeapTotalBytes": 9699328,
"scriptDurationMs": 96.10499999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66534653465347,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1945.1369999999883,
"styleRecalcs": 82,
"styleRecalcDurationMs": 11.509,
"layouts": 9,
"layoutDurationMs": 1.694,
"taskDurationMs": 744.999,
"heapDeltaBytes": 21757344,
"heapUsedBytes": 112510644,
"domNodes": 0,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 101.38600000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1708.7359999999876,
"styleRecalcs": 18,
"styleRecalcDurationMs": 4.4719999999999995,
"layouts": 12,
"layoutDurationMs": 2.6760000000000006,
"taskDurationMs": 254.99700000000004,
"heapDeltaBytes": 2263040,
"heapUsedBytes": 98105924,
"domNodes": 47,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 9.378,
"eventListeners": 37,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666019417475727,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1708.8559999999688,
"styleRecalcs": 18,
"styleRecalcDurationMs": 3.843,
"layouts": 12,
"layoutDurationMs": 2.371,
"taskDurationMs": 249.428,
"heapDeltaBytes": 23732152,
"heapUsedBytes": 112306484,
"domNodes": 47,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 9.377999999999998,
"eventListeners": 37,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666990291262138,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 484.07100000002856,
"styleRecalcs": 15,
"styleRecalcDurationMs": 3.1959999999999997,
"layouts": 11,
"layoutDurationMs": 2.901,
"taskDurationMs": 310.238,
"heapDeltaBytes": 5135480,
"heapUsedBytes": 94582568,
"domNodes": 0,
"jsHeapTotalBytes": 7340032,
"scriptDurationMs": 117.556,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379316,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 483.20400000000063,
"styleRecalcs": 15,
"styleRecalcDurationMs": 3.057,
"layouts": 10,
"layoutDurationMs": 2.4130000000000003,
"taskDurationMs": 319.11699999999996,
"heapDeltaBytes": 2367676,
"heapUsedBytes": 105216472,
"domNodes": 0,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 107.91499999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379302,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 922.1529999999802,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 551.688,
"heapDeltaBytes": -13603252,
"heapUsedBytes": 102173424,
"domNodes": -211,
"jsHeapTotalBytes": 14753792,
"scriptDurationMs": 38.611,
"eventListeners": -168,
"totalBlockingTimeMs": 276,
"frameDurationMs": 25.925000000000004,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 909.9209999999971,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 551.825,
"heapDeltaBytes": -16837076,
"heapUsedBytes": 102566816,
"domNodes": -230,
"jsHeapTotalBytes": 15880192,
"scriptDurationMs": 38.748999999999995,
"eventListeners": -168,
"totalBlockingTimeMs": 270,
"frameDurationMs": 26.188571428571425,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 770.4930000000445,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 359.25399999999996,
"heapDeltaBytes": -4487608,
"heapUsedBytes": 97375196,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 124.09,
"eventListeners": 0,
"totalBlockingTimeMs": 146,
"frameDurationMs": 22.547058823529422,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 702.0970000000375,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 288.9500000000003,
"heapDeltaBytes": -3993064,
"heapUsedBytes": 98127308,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 94.14899999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 95,
"frameDurationMs": 20.58529411764705,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6557.62500000003,
"styleRecalcs": 3,
"styleRecalcDurationMs": 0.8600000000000005,
"layouts": 3,
"layoutDurationMs": 0.7750000000000001,
"taskDurationMs": 5489.167,
"heapDeltaBytes": 2966452,
"heapUsedBytes": 124488880,
"domNodes": -296,
"jsHeapTotalBytes": 28377088,
"scriptDurationMs": 4259.126,
"eventListeners": -130,
"totalBlockingTimeMs": 32,
"frameDurationMs": 20.912101910828024,
"p95FrameDurationMs": 33.400000000000546
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6010.728999999969,
"styleRecalcs": 3,
"styleRecalcDurationMs": 0.6849999999999998,
"layouts": 3,
"layoutDurationMs": 0.631,
"taskDurationMs": 4998.839999999999,
"heapDeltaBytes": 12706752,
"heapUsedBytes": 135101692,
"domNodes": -296,
"jsHeapTotalBytes": 27328512,
"scriptDurationMs": 3953.9030000000002,
"eventListeners": -130,
"totalBlockingTimeMs": 22,
"frameDurationMs": 20.47713310580205,
"p95FrameDurationMs": 33.40000000000009
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6437.807999999961,
"styleRecalcs": 4,
"styleRecalcDurationMs": 1.13,
"layouts": 4,
"layoutDurationMs": 0.9450000000000001,
"taskDurationMs": 5236.067999999999,
"heapDeltaBytes": 22617892,
"heapUsedBytes": 144381000,
"domNodes": -296,
"jsHeapTotalBytes": 23920640,
"scriptDurationMs": 4070.5529999999994,
"eventListeners": -130,
"totalBlockingTimeMs": 29,
"frameDurationMs": 20.553035143769968,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6202.9220000000005,
"styleRecalcs": 3,
"styleRecalcDurationMs": 0.7039999999999997,
"layouts": 3,
"layoutDurationMs": 0.6410000000000001,
"taskDurationMs": 5051.9800000000005,
"heapDeltaBytes": 12207556,
"heapUsedBytes": 133690472,
"domNodes": -296,
"jsHeapTotalBytes": 26279936,
"scriptDurationMs": 3977.1870000000004,
"eventListeners": -130,
"totalBlockingTimeMs": 25,
"frameDurationMs": 20.39407894736842,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "large-combo-open",
"durationMs": 137.3699999999758,
"styleRecalcs": 20,
"styleRecalcDurationMs": 11.490999999999998,
"layouts": 11,
"layoutDurationMs": 2.9139999999999997,
"taskDurationMs": 96.743,
"heapDeltaBytes": 15417052,
"heapUsedBytes": 117995448,
"domNodes": 917,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 5.818,
"eventListeners": 196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 21.428571428571427,
"p95FrameDurationMs": 33.30000000000018
},
{
"name": "large-combo-open",
"durationMs": 148.22099999997818,
"styleRecalcs": 22,
"styleRecalcDurationMs": 10.714000000000002,
"layouts": 13,
"layoutDurationMs": 2.937,
"taskDurationMs": 100.434,
"heapDeltaBytes": 13242832,
"heapUsedBytes": 117451384,
"domNodes": 917,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 5.718,
"eventListeners": 196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 19.04285714285717,
"p95FrameDurationMs": 33.30000000000018
},
{
"name": "large-graph-idle",
"durationMs": 2041.5669999999864,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.613,
"layouts": 8,
"layoutDurationMs": 2.167,
"taskDurationMs": 483.726,
"heapDeltaBytes": -24433368,
"heapUsedBytes": 96661048,
"domNodes": -296,
"jsHeapTotalBytes": -655360,
"scriptDurationMs": 31.580000000000005,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536587,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2025.2929999999765,
"styleRecalcs": 10,
"styleRecalcDurationMs": 1.9310000000000005,
"layouts": 10,
"layoutDurationMs": 1.8739999999999999,
"taskDurationMs": 403.692,
"heapDeltaBytes": -22268988,
"heapUsedBytes": 98130196,
"domNodes": -296,
"jsHeapTotalBytes": -3538944,
"scriptDurationMs": 23.595,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6672131147541,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2149.9200000000087,
"styleRecalcs": 70,
"styleRecalcDurationMs": 10.916,
"layouts": 9,
"layoutDurationMs": 2.097,
"taskDurationMs": 1047.196,
"heapDeltaBytes": 1367856,
"heapUsedBytes": 103919056,
"domNodes": -296,
"jsHeapTotalBytes": -757760,
"scriptDurationMs": 560.6379999999999,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665891472868218,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2217.6809999999705,
"styleRecalcs": 70,
"styleRecalcDurationMs": 10.546,
"layouts": 9,
"layoutDurationMs": 2.091,
"taskDurationMs": 1164.188,
"heapDeltaBytes": -33033260,
"heapUsedBytes": 88542264,
"domNodes": -296,
"jsHeapTotalBytes": 655360,
"scriptDurationMs": 564.549,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666917293233084,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "large-graph-zoom",
"durationMs": 3109.117000000026,
"styleRecalcs": 74,
"styleRecalcDurationMs": 11.23,
"layouts": 67,
"layoutDurationMs": 11.48,
"taskDurationMs": 1118.82,
"heapDeltaBytes": -15974548,
"heapUsedBytes": 88210804,
"domNodes": 24,
"jsHeapTotalBytes": -1114112,
"scriptDurationMs": 531.031,
"eventListeners": -126,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665775401069517,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3520.1090000000477,
"styleRecalcs": 74,
"styleRecalcDurationMs": 11.620000000000001,
"layouts": 68,
"layoutDurationMs": 12.257,
"taskDurationMs": 1322.659,
"heapDeltaBytes": 6441256,
"heapUsedBytes": 114860364,
"domNodes": -272,
"jsHeapTotalBytes": 16527360,
"scriptDurationMs": 554.1239999999999,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665714285714287,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 2139.352000000031,
"styleRecalcs": 45,
"styleRecalcDurationMs": 5.916,
"layouts": 6,
"layoutDurationMs": 1.4120000000000001,
"taskDurationMs": 1255.6190000000001,
"heapDeltaBytes": 15982704,
"heapUsedBytes": 125579172,
"domNodes": 0,
"jsHeapTotalBytes": 5926912,
"scriptDurationMs": 633.077,
"eventListeners": 182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666406249999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2203.318000000081,
"styleRecalcs": 45,
"styleRecalcDurationMs": 6.178,
"layouts": 5,
"layoutDurationMs": 1.202,
"taskDurationMs": 1303.6970000000001,
"heapDeltaBytes": 18319584,
"heapUsedBytes": 129071876,
"domNodes": 0,
"jsHeapTotalBytes": 5664768,
"scriptDurationMs": 652.07,
"eventListeners": 182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665909090909093,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "minimap-idle",
"durationMs": 2021.462999999983,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.1730000000000005,
"layouts": 10,
"layoutDurationMs": 2.063,
"taskDurationMs": 311.0370000000001,
"heapDeltaBytes": 5430884,
"heapUsedBytes": 108344916,
"domNodes": -276,
"jsHeapTotalBytes": -5963776,
"scriptDurationMs": 24.431999999999995,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "minimap-idle",
"durationMs": 2023.6609999999473,
"styleRecalcs": 10,
"styleRecalcDurationMs": 1.8400000000000005,
"layouts": 9,
"layoutDurationMs": 1.6909999999999998,
"taskDurationMs": 297.08699999999993,
"heapDeltaBytes": 3708188,
"heapUsedBytes": 106368048,
"domNodes": -276,
"jsHeapTotalBytes": -6488064,
"scriptDurationMs": 20.712999999999997,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 429.76000000004433,
"styleRecalcs": 48,
"styleRecalcDurationMs": 5.2090000000000005,
"layouts": 10,
"layoutDurationMs": 2.81,
"taskDurationMs": 293.969,
"heapDeltaBytes": 22476016,
"heapUsedBytes": 112324152,
"domNodes": 0,
"jsHeapTotalBytes": 3145728,
"scriptDurationMs": 97.363,
"eventListeners": 46,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665384615384603,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 464.81900000003407,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.682999999999999,
"layouts": 9,
"layoutDurationMs": 2.3989999999999996,
"taskDurationMs": 306.83700000000005,
"heapDeltaBytes": 22446380,
"heapUsedBytes": 112424744,
"domNodes": 0,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 102.64500000000001,
"eventListeners": 46,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66428571428571,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-idle",
"durationMs": 2025.3900000000158,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.34,
"layouts": 9,
"layoutDurationMs": 2.033,
"taskDurationMs": 277.43899999999996,
"heapDeltaBytes": 1398884,
"heapUsedBytes": 91094788,
"domNodes": -218,
"jsHeapTotalBytes": 2162688,
"scriptDurationMs": 6.322999999999999,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2026.3279999999781,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.248,
"layouts": 10,
"layoutDurationMs": 1.9959999999999996,
"taskDurationMs": 375.88200000000006,
"heapDeltaBytes": -17995700,
"heapUsedBytes": 81676304,
"domNodes": -219,
"jsHeapTotalBytes": 4288512,
"scriptDurationMs": 5.315,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1678.688999999963,
"styleRecalcs": 75,
"styleRecalcDurationMs": 12.52,
"layouts": 10,
"layoutDurationMs": 2.063,
"taskDurationMs": 593.816,
"heapDeltaBytes": 18651652,
"heapUsedBytes": 109839616,
"domNodes": 0,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 89.209,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666336633663363,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1682.6550000000111,
"styleRecalcs": 75,
"styleRecalcDurationMs": 12.195,
"layouts": 11,
"layoutDurationMs": 2.2729999999999997,
"taskDurationMs": 542.156,
"heapDeltaBytes": -6320292,
"heapUsedBytes": 92036556,
"domNodes": 0,
"jsHeapTotalBytes": 9175040,
"scriptDurationMs": 74.49600000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665346534653462,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-transition-enter",
"durationMs": 900.8210000000076,
"styleRecalcs": 18,
"styleRecalcDurationMs": 16.355999999999998,
"layouts": 5,
"layoutDurationMs": 10.344000000000001,
"taskDurationMs": 669.1040000000002,
"heapDeltaBytes": 37744640,
"heapUsedBytes": 169858468,
"domNodes": 16030,
"jsHeapTotalBytes": 44965888,
"scriptDurationMs": 19.627,
"eventListeners": 3244,
"totalBlockingTimeMs": 72,
"frameDurationMs": 19.565217391304348,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8350.623000000041,
"styleRecalcs": 250,
"styleRecalcDurationMs": 37.073,
"layouts": 9,
"layoutDurationMs": 2.254,
"taskDurationMs": 4036.792999999999,
"heapDeltaBytes": -3628028,
"heapUsedBytes": 103457668,
"domNodes": -296,
"jsHeapTotalBytes": 552960,
"scriptDurationMs": 1886.82,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665868263473055,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8353.504000000044,
"styleRecalcs": 250,
"styleRecalcDurationMs": 34.592000000000006,
"layouts": 8,
"layoutDurationMs": 1.8290000000000002,
"taskDurationMs": 3920.5560000000005,
"heapDeltaBytes": -222604,
"heapUsedBytes": 108045740,
"domNodes": -297,
"jsHeapTotalBytes": -389120,
"scriptDurationMs": 1843.5869999999998,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666067864271454,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15333.85800000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14527.961000000001,
"heapDeltaBytes": -21761484,
"heapUsedBytes": 289433132,
"domNodes": -3344,
"jsHeapTotalBytes": 27774976,
"scriptDurationMs": 187.85999999999999,
"eventListeners": -653,
"totalBlockingTimeMs": 0,
"frameDurationMs": 26.120442930153327,
"p95FrameDurationMs": 50
},
{
"name": "vue-large-graph-idle",
"durationMs": 14628.753999999957,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13601.967999999999,
"heapDeltaBytes": -10700364,
"heapUsedBytes": 298011428,
"domNodes": -3344,
"jsHeapTotalBytes": 23584768,
"scriptDurationMs": 162.959,
"eventListeners": -657,
"totalBlockingTimeMs": 0,
"frameDurationMs": 24.759221658206428,
"p95FrameDurationMs": 50
},
{
"name": "vue-large-graph-pan",
"durationMs": 18334.203999999998,
"styleRecalcs": 157,
"styleRecalcDurationMs": 16.22299999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18039.795000000002,
"heapDeltaBytes": 2632616,
"heapUsedBytes": 308547924,
"domNodes": -3344,
"jsHeapTotalBytes": 14336000,
"scriptDurationMs": 617.0939999999999,
"eventListeners": -651,
"totalBlockingTimeMs": 1,
"frameDurationMs": 34.655009451795834,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-large-graph-pan",
"durationMs": 17797.48099999995,
"styleRecalcs": 153,
"styleRecalcDurationMs": 16.476999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17526.102000000003,
"heapDeltaBytes": 3732844,
"heapUsedBytes": 309726828,
"domNodes": -3344,
"jsHeapTotalBytes": 14860288,
"scriptDurationMs": 631.0440000000001,
"eventListeners": -651,
"totalBlockingTimeMs": 0,
"frameDurationMs": 33.83878326996198,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 5325.85899999998,
"styleRecalcs": 20,
"styleRecalcDurationMs": 39.630999999999986,
"layouts": 20,
"layoutDurationMs": 18.137,
"taskDurationMs": 5236.662000000001,
"heapDeltaBytes": -50403532,
"heapUsedBytes": 275487576,
"domNodes": -3344,
"jsHeapTotalBytes": 25153536,
"scriptDurationMs": 70.759,
"eventListeners": -653,
"totalBlockingTimeMs": 0,
"frameDurationMs": 32.61656441717791,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 5391.789000000017,
"styleRecalcs": 20,
"styleRecalcDurationMs": 43.53199999999999,
"layouts": 20,
"layoutDurationMs": 19.293000000000006,
"taskDurationMs": 5250.178999999999,
"heapDeltaBytes": -27175004,
"heapUsedBytes": 273883068,
"domNodes": -3344,
"jsHeapTotalBytes": 22794240,
"scriptDurationMs": 86.43400000000001,
"eventListeners": -653,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.952071005917162,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5377.2399999999725,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5052.855000000001,
"heapDeltaBytes": -4578344,
"heapUsedBytes": 289934360,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 66.06200000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.94782608695653,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7262.783000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6822.81,
"heapDeltaBytes": 19100688,
"heapUsedBytes": 299860136,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 87.35900000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 24.383557046979863,
"p95FrameDurationMs": 33.5
},
{
"name": "workflow-execution",
"durationMs": 89.48500000002468,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.279,
"layouts": 6,
"layoutDurationMs": 1.91,
"taskDurationMs": 60.480000000000004,
"heapDeltaBytes": 4801132,
"heapUsedBytes": 104455000,
"domNodes": 97,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 6.919,
"eventListeners": 1,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 87.43600000002516,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.42,
"layouts": 6,
"layoutDurationMs": 2.187,
"taskDurationMs": 57.01499999999999,
"heapDeltaBytes": 4647324,
"heapUsedBytes": 96307552,
"domNodes": 94,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 5.113000000000001,
"eventListeners": 1,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.680000000000017,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 245.4250000000684,
"styleRecalcs": 5,
"styleRecalcDurationMs": 0.641,
"layouts": 76,
"layoutDurationMs": 11.99,
"taskDurationMs": 198.368,
"heapDeltaBytes": 9765788,
"heapUsedBytes": 97049104,
"domNodes": 4,
"jsHeapTotalBytes": 9699328,
"scriptDurationMs": 84.634,
"eventListeners": 292,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 198.48599999988892,
"styleRecalcs": 5,
"styleRecalcDurationMs": 0.6,
"layouts": 76,
"layoutDurationMs": 9.187000000000001,
"taskDurationMs": 151.893,
"heapDeltaBytes": 9223912,
"heapUsedBytes": 96322760,
"domNodes": 4,
"jsHeapTotalBytes": 9437184,
"scriptDurationMs": 64.357,
"eventListeners": 292,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 241.46799999994073,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.4569999999999999,
"layouts": 76,
"layoutDurationMs": 9.715,
"taskDurationMs": 213.332,
"heapDeltaBytes": -2111836,
"heapUsedBytes": 114828456,
"domNodes": 4,
"jsHeapTotalBytes": 1835008,
"scriptDurationMs": 69.222,
"eventListeners": 292,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66874999999999,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 247.96099999991839,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.163,
"layouts": 76,
"layoutDurationMs": 9.475000000000001,
"taskDurationMs": 199.46,
"heapDeltaBytes": -2196424,
"heapUsedBytes": 114735196,
"domNodes": 4,
"jsHeapTotalBytes": 1572864,
"scriptDurationMs": 64.81200000000001,
"eventListeners": 292,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E CoverageLine coverage: 63.7% Coverage totals
Top 10 files by uncovered lines
🎭 Playwright: ✅ 2991 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
Findings and check detailsThe matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was 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 🌾 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. Findings and check detailsNo new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since d5a25c291ea57c1877452fe82b7d4b02ee394ecc
Full docs: ADR-DEVEX-LINT-0015 🏛️ Architecture: ✅ PassedFindings and check detailsWarnings (140)
Reproduce locallypnpm architecture:checkFull docs: Frontend domain catalog |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## cloud/1.58 #22397 +/- ##
=============================================
Coverage ? 84.23%
=============================================
Files ? 3171
Lines ? 165417
Branches ? 41529
=============================================
Hits ? 139346
Misses ? 25680
Partials ? 391
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dante01yoon
left a comment
There was a problem hiding this comment.
Backport approval. The PR merges cleanly into its release branch and CI is green.
…he workflow picker saves it (FRONT-3774) (#22819) Backport of #22649 then #22648 to `cloud/1.58`. Fixes [FRONT-3774](https://linear.app/comfyorg/issue/FRONT-3774): picking an unopened unsaved tab in the Agent workflow picker after a reload could not save it, and the tab's draft was deleted. Found in release QA case C-163 on 1.59.3; the same code is on 1.58. - **Applies here:** `cloud/1.58` has both defects. With the two fixes reverted, all five new tests fail on this branch (2 draft-deletion, 3 picker); with them, they pass. - **Same symptom as 1.59:** `cloud/1.58` has #21326's guard (as #22397), so the pick fails with "Save failed · Cannot save workflow … before it is loaded". - **Two commits, source order.** Conflicts were imports only; behaviour hunks apply unchanged. <details><summary>Full context for agent readers</summary> Commits, in order: the two `core/1.58` carrier commits (#22818, each `cherry-pick -x` from `main`), which apply cleanly here. Their resolutions: 1. #22649 `9580dff303`, fix(workflow): stop deleting an unsaved tab's draft on a same-path save or its first load. - `useWorkflowPersistenceV2.test.ts` import conflict: kept the train's `vue` import (this change adds no `computed`/`ref` use) and took the source's `vitest` import with `onTestFinished`, which the new test uses. - `useWorkflowPersistenceV2.ts` imports `ComfyWorkflowJSON` from `@/platform/workflow/validation/schemas/workflowSchema`, because 1.58 predates the `@comfyorg/graph-model` package. Same resolution the bot used on `core/1.59` (#22667). 2. #22648 `816ea98f48`, fix(agent): load an unopened unsaved tab before the workflow picker saves it. - `workflowService.test.ts` import conflict: kept the train's imports plus `blankGraph`, which the new `loadWorkflowInBackground` test uses (`getDefaultWorkflow` from `main` is not used by this change). - `agentWorkflowSelection.spec.ts`: same `ComfyWorkflowJSON` import-path change as above. Every `browser_tests/` hunk from both sources is carried; none is dropped. Local checks on this tree (Node 24): `typecheck` (pre-commit) and `typecheck:browser` pass; pre-push depcruise and knip pass. Vitest on `useAgentWorkflowSelection.test.ts`, `workflowService.test.ts`, `AgentPanelRoot.test.ts` and `src/platform/workflow/persistence/`: 807 passed, 1 expected fail, 14 files. The new browser case `picks an unsaved tab a reload left unopened` runs in CI (`e2e-status`). Authority: the program's release-backport grant for the current trains (`cloud/1.58` is listed). </details> Justification: Release backport of FRONT-3774 fixes (#22648, plus #22649 where the train lacked it) to cloud/1.58 under the standing agent backport review-and-merge grant for the current trains. Production hunks match the source PRs line for line (only a train-local import path differs); the source unit tests fail on the train tip without the carrier and pass with it; all required checks pass at 8634d19; no unresolved threads.
Summary
cloud/1.58, the release line currently serving the production events tracked in PM-2409.nullworkflow content from entering workflow load/save and makes ChangeTracker comparison fail safe when either graph state is null.Production evidence
Sentry issue
CLOUD-FRONTEND-PROD-36Dcontains one production throw captured twice (global and Vue handlers): 2 raw events / 1 user on release1.58.0, Windows/Electron. The exactgraphEqualfailure family spans 15 Sentry groups and 614 raw events since 2026-10-05 across releases 1.55.17–1.58.0. Raw counts include handled/unhandled and dual-capture groups, so they are not unique crashes or users.The PM-2409 path is node shape customization: the node shape is assigned, then
captureCanvasState()throws while comparing against a null stored graph. The visible mutation may occur, but the dirty/undo checkpoint and subsequent menu completion are interrupted.This is the same root cause already owned by FRONT-3169 and fixed on
mainby #21326.cloud/1.58still had the unguarded implementation.Backport notes
lateCustomNodesmocks frommainwere omitted because those modules do not exist oncloud/1.58; the branch's existingmockAssertsetup was retained.Verification
NODE_OPTIONS=--no-experimental-webstorage pnpm exec vitest run src/platform/workflow/core/services/workflowService.test.ts src/platform/workflow/management/stores/comfyWorkflow.test.ts src/platform/workflow/management/stores/workflowStore.test.ts src/scripts/changeTracker.test.ts— 350 passedpnpm typecheck— passedpnpm typecheck:browser— passedoxlint --type-awareandoxfmt --check— passedVITE_USE_LEGACY_DEFAULT_GRAPH=true pnpm build— passedscripts/test-browser-offline.sh --project=chromium workflowNullStoredContent.spec.ts— 1 passedThis PR is a carrier only; production remains affected until the release line is deployed.