Repository navigation
[backport cloud/1.53] fix: normalize nested subgraph definition ids and cover node-shell input rehydration - #16809
Conversation
…put rehydration (#16546) Recursive subgraph-definition id normalization plus coverage for node-shell input rehydration and the brush-cursor rect read. Rebased onto current `main`; the node-replacement half was dropped because it landed separately. <details><summary>Full context for agent readers</summary> Addresses part of #15973. ## Included 1. **Input-slot rehydration must not narrow to the `LGraphNode` constructor path** — `createNodeShellState` (the sole `NodeState` builder) returned a plain `shallowReactive` array for `inputs`; only `LGraphNode`'s constructor wrapped it with `createInputSlotView`, so a `NodeState` built any other way silently lost rehydration. The wrap now lives in `createNodeShellState` itself, injected as a parameter (`InputSlotViewFactory`) rather than statically imported: a static import there re-enters the litegraph module cycle at a point where `LGraphNode` is not yet defined (`TypeError: Class extends value undefined` in `SubgraphNode.ts`). Regression test constructs `NodeState` via `createNodeShellState` directly. 2. **Fixes #16010** — restores the deleted "read the container rect once per position, not once per axis" coverage for `BrushCursor`, adapted to the `useElementBounding()` implementation. Also characterizes a remaining gap: `useElementBounding()`'s observers do not see an ancestor moved via a transform on a non-target ancestor; only the next cursor move re-syncs via this component's `watch(cursorPoint, update)`. Coverage only; wiring an explicit recompute to dialog movement is separate follow-up work. 3. **Fixes #16012** — `normalizeSubgraphDefinitionIds` only normalized ids in the top-level `subgraphs` array and never descended into a definition's own nested `definitions.subgraphs` (structurally valid per `ExportedSubgraph extends SerialisableGraph`, never produced by our serializer, so this matters for external tools and older exports). Nested definitions are now recursively flattened into the returned list (clearing the redundant nested field) before the existing id-normalization and reference-rewrite pass. Tests cover one level, multi-level, empty, and sibling nesting. ## Dropped during rebase (already on `main`) - The per-node missing-node-warning tracking (#16011) was superseded by [#16464](#16464), which fixed the same defect per type. Keeping both would have shipped two overlapping designs for one bug, so those commits were removed rather than reconciled. - The "documented identity break" test and JSDoc for `getInputSlotPos` were removed: [#16510](#16510) made a retained plain-object reference resolvable, so the documented break no longer exists. `main`'s test for the fixed behavior is kept as-is. - #16009 was fixed by #16458; #16013 was fixed by #16512. Nothing duplicated here. ## Testing Focused `vitest` on the touched files and the `subgraph/` directory (399 tests), `vue-tsc --noEmit`, `oxlint` (type-aware) and `oxfmt --check` on the touched files — all clean on the rebased head. The recursive-normalization tests fail against the pre-fix code. </details> <!-- authored-by:agent w3-w20 -->
🎭 Playwright: ✅ 1893 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-03T18:00:16.245Z",
"gitSha": "4d99a45c24697190893c597c87fbfd1c586605ef",
"branch": "backport-16546-to-cloud-1.53",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2068.4459999999945,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.947999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 572.345,
"heapDeltaBytes": -11439172,
"heapUsedBytes": 58883768,
"domNodes": -279,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 9.385000000000002,
"eventListeners": -157,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2017.971999999986,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.451999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 491.4560000000001,
"heapDeltaBytes": -11288272,
"heapUsedBytes": 58198704,
"domNodes": -283,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 8.251999999999999,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1799.1499999999405,
"styleRecalcs": 76,
"styleRecalcDurationMs": 36.324000000000005,
"layouts": 14,
"layoutDurationMs": 4.523,
"taskDurationMs": 861.9519999999999,
"heapDeltaBytes": -7937668,
"heapUsedBytes": 62196680,
"domNodes": -281,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 153.29000000000002,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1861.8960000000015,
"styleRecalcs": 79,
"styleRecalcDurationMs": 38.900999999999996,
"layouts": 14,
"layoutDurationMs": 4.033,
"taskDurationMs": 898.1250000000001,
"heapDeltaBytes": 5265196,
"heapUsedBytes": 75592448,
"domNodes": -279,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 163.59400000000002,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1685.0130000000263,
"styleRecalcs": 29,
"styleRecalcDurationMs": 17.332,
"layouts": 6,
"layoutDurationMs": 1.14,
"taskDurationMs": 365.606,
"heapDeltaBytes": 4451668,
"heapUsedBytes": 74956376,
"domNodes": 76,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 11.122,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1723.186999999939,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.358999999999998,
"layouts": 6,
"layoutDurationMs": 1.041,
"taskDurationMs": 366.773,
"heapDeltaBytes": 4461996,
"heapUsedBytes": 74507812,
"domNodes": 77,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 11.241999999999999,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 644.3550000000187,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.810999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 454.62499999999994,
"heapDeltaBytes": 17833000,
"heapUsedBytes": 87455600,
"domNodes": 16,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 162.686,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 629.5630000000756,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.878000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 448.42400000000004,
"heapDeltaBytes": -7800592,
"heapUsedBytes": 62892692,
"domNodes": 20,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 160.443,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2035.0939999999582,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.864,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 584.058,
"heapDeltaBytes": -13546680,
"heapUsedBytes": 87129184,
"domNodes": -269,
"jsHeapTotalBytes": -2142208,
"scriptDurationMs": 36.521,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2066.4130000000114,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.753,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 612.9350000000002,
"heapDeltaBytes": 10899888,
"heapUsedBytes": 86781524,
"domNodes": -271,
"jsHeapTotalBytes": -1916928,
"scriptDurationMs": 33.817,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2257.127999999966,
"styleRecalcs": 67,
"styleRecalcDurationMs": 11.685999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1604.192,
"heapDeltaBytes": 14917044,
"heapUsedBytes": 80134160,
"domNodes": -270,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 805.738,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2308.2319999999754,
"styleRecalcs": 63,
"styleRecalcDurationMs": 8.256000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1622.118,
"heapDeltaBytes": 22695604,
"heapUsedBytes": 88503368,
"domNodes": -276,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 808.569,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3517.1890000000303,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.433999999999997,
"layouts": 60,
"layoutDurationMs": 11.340000000000003,
"taskDurationMs": 1659.703,
"heapDeltaBytes": 12043840,
"heapUsedBytes": 79489140,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 742.491,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3437.26300000003,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.346999999999998,
"layouts": 60,
"layoutDurationMs": 11.28,
"taskDurationMs": 1619.0160000000003,
"heapDeltaBytes": 8162420,
"heapUsedBytes": 75660056,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 726.566,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3115.3060000000323,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.659,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1920.5379999999998,
"heapDeltaBytes": 22246312,
"heapUsedBytes": 89183840,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 947.322,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3097.759999999994,
"styleRecalcs": 41,
"styleRecalcDurationMs": 5.355000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1912.1189999999997,
"heapDeltaBytes": 23205672,
"heapUsedBytes": 89872360,
"domNodes": -276,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 941.0070000000002,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2026.585999999952,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.2709999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 551.4250000000001,
"heapDeltaBytes": 21856076,
"heapUsedBytes": 87579728,
"domNodes": -272,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 31.369000000000007,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2002.7760000000399,
"styleRecalcs": 1,
"styleRecalcDurationMs": 3.436999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 553.62,
"heapDeltaBytes": 21776088,
"heapUsedBytes": 87136140,
"domNodes": -278,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 32.234,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 594.8710000000119,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.794999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 420.7369999999999,
"heapDeltaBytes": 14341816,
"heapUsedBytes": 85972684,
"domNodes": 20,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 141.78000000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 608.0949999999348,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.549999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 412.541,
"heapDeltaBytes": 14747020,
"heapUsedBytes": 87403404,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 142.97000000000003,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2023.0099999999993,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.415,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.79100000000005,
"heapDeltaBytes": 2880008,
"heapUsedBytes": 75596244,
"domNodes": -296,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 7.893999999999998,
"eventListeners": -231,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2021.284000000037,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.708000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 491.349,
"heapDeltaBytes": -7775964,
"heapUsedBytes": 64945172,
"domNodes": -296,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 7.564000000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1718.6290000000781,
"styleRecalcs": 77,
"styleRecalcDurationMs": 37.859,
"layouts": 18,
"layoutDurationMs": 5.666999999999999,
"taskDurationMs": 837.567,
"heapDeltaBytes": -11990296,
"heapUsedBytes": 60362300,
"domNodes": -298,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 110.43599999999999,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1721.8070000000125,
"styleRecalcs": 77,
"styleRecalcDurationMs": 35.491,
"layouts": 18,
"layoutDurationMs": 4.695,
"taskDurationMs": 816.5830000000001,
"heapDeltaBytes": -11652976,
"heapUsedBytes": 60691824,
"domNodes": -294,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 106.57,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1417.2059999999647,
"styleRecalcs": 17,
"styleRecalcDurationMs": 31.347,
"layouts": 13,
"layoutDurationMs": 17.098,
"taskDurationMs": 931.4720000000001,
"heapDeltaBytes": 21161468,
"heapUsedBytes": 108358888,
"domNodes": 13751,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 31.741000000000007,
"eventListeners": 2381,
"totalBlockingTimeMs": 141,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8528.055999999993,
"styleRecalcs": 247,
"styleRecalcDurationMs": 35.355,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5834.334,
"heapDeltaBytes": 13355552,
"heapUsedBytes": 88516108,
"domNodes": -273,
"jsHeapTotalBytes": -905216,
"scriptDurationMs": 2602.188,
"eventListeners": -169,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8466.046000000006,
"styleRecalcs": 248,
"styleRecalcDurationMs": 34.875,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5796.013,
"heapDeltaBytes": -12025808,
"heapUsedBytes": 88388880,
"domNodes": -270,
"jsHeapTotalBytes": -868352,
"scriptDurationMs": 2650.1580000000004,
"eventListeners": -139,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17496.25900000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16777.411,
"heapDeltaBytes": -22834844,
"heapUsedBytes": 179377596,
"domNodes": -6548,
"jsHeapTotalBytes": 2084864,
"scriptDurationMs": 283.392,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 17010.60099999984,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16543.716,
"heapDeltaBytes": -32742236,
"heapUsedBytes": 175785900,
"domNodes": -6548,
"jsHeapTotalBytes": -3420160,
"scriptDurationMs": 271.092,
"eventListeners": -7471,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20720.768000000022,
"styleRecalcs": 165,
"styleRecalcDurationMs": 17.708000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20330.016,
"heapDeltaBytes": -19235296,
"heapUsedBytes": 190095612,
"domNodes": -6548,
"jsHeapTotalBytes": -2592768,
"scriptDurationMs": 853.759,
"eventListeners": -7471,
"totalBlockingTimeMs": 44,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 20494.99999999989,
"styleRecalcs": 167,
"styleRecalcDurationMs": 17.305999999999987,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20111.697,
"heapDeltaBytes": -22226496,
"heapUsedBytes": 179958492,
"domNodes": -6548,
"jsHeapTotalBytes": 1568768,
"scriptDurationMs": 903.9609999999999,
"eventListeners": -7469,
"totalBlockingTimeMs": 87,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6109.93499999995,
"styleRecalcs": 20,
"styleRecalcDurationMs": 90.55399999999997,
"layouts": 20,
"layoutDurationMs": 27.714000000000016,
"taskDurationMs": 5997.237999999999,
"heapDeltaBytes": -28722004,
"heapUsedBytes": 174287228,
"domNodes": -6548,
"jsHeapTotalBytes": 9084928,
"scriptDurationMs": 107.04799999999999,
"eventListeners": -7469,
"totalBlockingTimeMs": 362,
"frameDurationMs": 17.773333333333298,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6117.600999999922,
"styleRecalcs": 20,
"styleRecalcDurationMs": 86.85499999999996,
"layouts": 20,
"layoutDurationMs": 34.25300000000001,
"taskDurationMs": 6016.472000000002,
"heapDeltaBytes": -26035548,
"heapUsedBytes": 184108016,
"domNodes": -6548,
"jsHeapTotalBytes": 4694016,
"scriptDurationMs": 104.046,
"eventListeners": -7471,
"totalBlockingTimeMs": 572,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 486.3080000000082,
"styleRecalcs": 18,
"styleRecalcDurationMs": 21.670999999999996,
"layouts": 3,
"layoutDurationMs": 2.5100000000000002,
"taskDurationMs": 115.92600000000002,
"heapDeltaBytes": 5315116,
"heapUsedBytes": 73771216,
"domNodes": 151,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 11.504000000000001,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 495.3969999999117,
"styleRecalcs": 12,
"styleRecalcDurationMs": 19.258,
"layouts": 3,
"layoutDurationMs": 0.9510000000000001,
"taskDurationMs": 126.14399999999998,
"heapDeltaBytes": 5050800,
"heapUsedBytes": 73417640,
"domNodes": 121,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 10.580999999999998,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## cloud/1.53 #16809 +/- ##
=============================================
Coverage ? 83.29%
=============================================
Files ? 2023
Lines ? 117044
Branches ? 32459
=============================================
Hits ? 97496
Misses ? 19200
Partials ? 348
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…y-Org#22013) ## Summary Uses the websocket contract Comfy-Org/ComfyUI#16763 and Comfy-Org#16809 shipped, which the frontend never adopted: `queuePrompt` sent no `workflow_metadata`, so the server had nothing to stamp beyond the id inside `extra_pnginfo`. This sends it, reads what comes back, and uses it to place a job that no per-tab mapping knows about. Replaces Comfy-Org#20045. Comfy-Org#21666 landed the instance-keyed gate for the Agent while that PR was in review, so the headline cross-tab fix is already on main. What was left is here, rebuilt on top of it. ## Changes - `queuePrompt` sends `workflow_metadata: { workflow_id }`, and the stamped id is forwarded to the gate from `execution_start`, `progress_state`, the `executed` listener, and the binary preview header, whose decoder was dropping it. - The ownership gate — now `rememberStampAndCheckActiveWorkflow`, named for the per-job stamp it records — gains two legs below `instanceId`: the session path, then the frame's own workflow id. The graph id is the weakest leg on purpose, because every copy of a workflow shares it, so copy-paste into a new tab gives two tabs one id and keying on it first makes each match the other's jobs. - The all-zero UUID is discarded rather than compared, on both sides. It is `LGraph._id`'s default and the codebase reads it as "no id yet", so comparing it as a real id matched nothing and rejected a fresh graph's own frames. - `forgetFinishedJobs` releases the tab's workflow status. Only a terminal frame cleared it, so a job that ended without one left the badge claiming the tab was running for the rest of the session. It releases an orphaned Running badge only: a workflow whose newer job already completed keeps its Completed or Failed badge when an older unreadable job is forgotten. - ADR-EXECUTION-ROUTING-0049 records the resolution order and that the unresolvable-frame fallback departs from ADR-GRAPH-DOCUMENT-0026 D2, with the condition for removing the exception. ## Review focus - **Comfy-Org#21666's gate had no unit coverage**, and the existing `executionStore` fixtures carry no `instanceId`, so nothing exercised the instance leg. `executionStore.workflowOwnership.test.ts` covers it first, so the behaviour this builds on is pinned before anything is added to it. - **The unresolvable fallback is the weakest point.** It is narrower than permissive, since a foreign job's unresolvable frame is dropped while another job is active, but with two tabs open and a frame unresolvable it can still land on the wrong one. The ADR says so. - **`progress_text` is still unattributable on current core.** Core packs it as a binary frame `send_sync` cannot stamp, and the frontend decodes a job id out of it only under `supports_progress_text_metadata`, which no core version sets — so the gate is called with no job id and returns before any stamp lookup. Comfy-Org/ComfyUI#16887 is what unblocks the leg. ## Tests Every change is verified by mutation: the fix reverted and the test confirmed to fail. Each wire boundary falsifies on its own — dropping the `workflow_metadata` spread fails the request rows, dropping the `!== zeroUuid` guard fails the sentinel row, removing `workflowId` from the type-4 decoder fails the preview decode, and removing either app forwarding argument fails the unmapped-routing case. Removing the instance comparison fails the shared-graph case, the path leg two, the workflow-id leg one, and the status release one. Store, request and decoder coverage lives in `executionStore.workflowOwnership.test.ts`, `executionStore.terminalRecovery.test.ts`, `api.queuePrompt.test.ts`, `api.previewMetadata.test.ts` and `app.test.ts`. `typecheck:app`, `typecheck:browser` and the `fallow` audit gate are clean, with 0 introduced findings of any kind. Both store suites register tabs through `workflowStore.attachWorkflow` rather than assigning `openWorkflows`, because `applyWorkflowStatus` refuses to record a status for a workflow the real `isOpen` does not consider open. Assigning the computed made the premise silently false. `browser_tests/tests/wsReconnectStaleJob.spec.ts` carries the black-box regression for the status release. It strands one unreadable job on each of two workflows — one of them the workflow's only job, the other alongside a live sibling — and uses the orphaned workflow's badge disappearing as the cleanup barrier before asserting the sibling's badge survives, because the detail-request counters move before the responses are fulfilled and cannot establish completion. Verified three ways on `--project=chromium`: 6/6 green on the repair and 3/3 on `--repeat-each=3`; failing at the barrier when cleanup is prevented from running, so the barrier is not vacuous; and failing at the sibling assertion under the pre-Comfy-Org#22013 clear ordering. Comfy-Org#20700 still covers replacing the remaining scripted reconnect specs with real-backend tests. ## Sibling overlap Overlaps Comfy-Org#20982 (draft) at `packages/api-client/src/ComfyApi.ts`, where both add a different member to the same `BackendApiCalls` interface: that PR an `agent_status` entry, this one `workflowId` on the existing `b_preview_with_metadata` entry. No shared behaviour or symbol. **Comfy-Org#11951 conflicts on policy, not on text.** It proposes a `messageMatchesActiveWorkflow` resolver that consults the frame's workflow id ahead of session ownership — the inverse of the order decided here, and the order that makes two tabs sharing one copied graph id match each other's jobs. Its resolver is superseded; remaining work there should be carried onto this gate rather than restoring the id-first policy during integration. Recorded in ADR-EXECUTION-ROUTING-0049 under the rejected alternatives. Needs a human call rather than being settled by this PR. **Comfy-Org#22186 landed first, and this branch carried the contracts across.** It merged 2026-10-30 (`d9290b0`), moving the API and execution contracts into `packages/api-client`. The merge of `main` at `24b64d62` relocated this PR's request field, preview decoding and stamped types into `packages/api-client/src/ComfyApi.ts` and `packages/api-client/src/executionTypes.ts`. The relocation is content-identical: comparing this PR's own diff before the merge (`9facf6c7`..`a8e25943`) against after it (`1bbea48f`..`24b64d62`), the entire changed-line delta is two lines out and six in, all in `api.previewMetadata.test.ts` — the `ComfyApi` import path and the constructor options the package now requires. No production line changed. **Comfy-Org#22271 (open) overlaps on ownership policy.** It adds an unconditional `detail.workflow_id !== this.rootGraph.id` rejection after the output ownership check, which can reject a job this PR's stronger instance/path identity accepts, and treats the all-zero UUID as a real identity rather than the "no id yet" default this PR discards. Its remaining coverage should be carried onto this PR's single ownership decision rather than kept as an independent guard. Same class of conflict as Comfy-Org#11951, and the same kind of human call. Proposed order is this PR first, since Comfy-Org#20982 is a draft that has not moved since 2026-10-18, then a one-line rebase there. Reversed is equally cheap: this branch would merge main and re-add its line. ## Derivation, and the control that it is load-bearing `workflow_metadata` is no longer hand-declared. Comfy-Org#22426 is on `main`, so both wire types now come from `@comfyorg/comfyui-api-types`, which generates core's `PromptRequest` from `openapi.yaml` pinned at `4281eb0a14`: ```ts // request — the spec's map narrowed to the one key this client sends workflow_metadata?: Pick<PromptWorkflowMetadata, 'workflow_id'> // frame — the map's VALUE type, not the map type StampedWorkflowId = { workflow_id?: PromptWorkflowMetadata[string] } ``` Core's spec defines no websocket frame schemas. It documents that `workflow_metadata` is echoed onto every JSON frame carrying a `prompt_id`, so the frame field is that request contract read back. The frame carries the map's contents merged into the frame object, which is why the value type is what transfers — a `Pick` or `Partial` of the map would describe the wrong shape here even though it would compile. The dependency is on `packages/api-client`, not the app, since `ComfyApi` builds the body. ### Verification Evidence **1. Delete the member from the pinned spec, regenerate — `pnpm typecheck` fails.** ``` packages/comfyui-api-types/src/index.ts(9,29): error TS2339: Property 'workflow_metadata' does not exist on type 'PromptRequest'. ``` Restored: spec hash back to `8f0da854…`, `check:generated` 0, `typecheck` 0. **2. That is not sufficient on its own.** The error above surfaces at the package's own alias — the first link in the chain — so it does not show that consumers are tied to the spec. Isolating them: retype the spec's value to `integer` *and* relax the package's `Record<string, string>` constraint, leaving consumers as the only thing that can fail. The retype reaches real call sites: ``` src/stores/executionStore.ts(592,38): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'string | undefined'. src/stores/executionStore.ts(593,55): error TS2345: … src/stores/executionStore.ts(752,64): error TS2345: … src/scripts/app.ts(782,11): error TS2345: … ``` Both controls reverted. Gates after restore: `typecheck` 0, `typecheck:browser` 0, `oxlint --type-aware` on both changed files 0 (verified scanning — an injected `no-explicit-any` is reported), 239 `packages/api-client` tests passing. `main` was merged rather than rebased, so existing review anchors are preserved.
Backport of #16546 to
cloud/1.53Automatically created by backport workflow.