Repository navigation
test: pin promoted-widget store ownership on demotion; clarify the guard reported on #19750 - #19761
christian-byrne wants to merge 1 commit into
Conversation
`SubgraphNode`'s deferred demotion frees a promoted widget's `widgetValueStore` entry behind `!this.inputs.some(i => i.widgetId === id)`. Read on its own that predicate means "nothing holds this id", which looks unconditionally true there because the input being demoted still carries the id until six lines later -- so reviewers of #19750 (the cloud/1.54 carrier for #18074) read it as dead code and proposed clearing `input.widgetId` first. Making it fire on an ordinary disconnect reverts #14495: the value typed on the host is kept across a disconnect precisely so that reconnecting restores it instead of reverting to the interior node's older value, and #18074 flipped that issue's e2e case off `test.fail()` on the strength of it. The guard is not dead -- it fires when the slot is removed in the same tick as the disconnect, so the input is gone from the node and nothing can promote it again. This spells that condition out (`this.inputs.includes(input)`), which is behaviour-identical, and adds the coverage that was missing on both sides of it. - `SubgraphWidgetPromotion.test.ts`: the host value survives an ordinary disconnect and a later reconnect; a same-tick rewire keeps the entry; removing the slot in the same tick as the disconnect frees it. - `subgraphPromotedWidgetDemotionCleanup.spec.ts`: #14495's symptom across a wider gap than its own case covers -- detach, leave the subgraph, come back, re-promote -- which is the scenario the #19750 reading would break. Verified on 2e2885b with Node 26: - `vitest run src/lib/litegraph/src/subgraph/ src/core/graph/subgraph/ src/stores/widgetValueStore.test.ts src/stores/domWidgetStore.test.ts src/composables/graph/useErrorClearingHooks.test.ts src/renderer/extensions/vueNodes/widgets/utils/multilineTextarea.promoted.test.ts` -- 34 files, 626 passed. - `playwright test browser_tests/tests/subgraph/subgraphPromotion.spec.ts subgraphPromotedWidgetRewireDuplication.spec.ts subgraphPromotedWidgetDemotionCleanup.spec.ts --project=chromium` -- 28 passed. - Mutation proof: applying the #19750 suggestion turns the new unit case, the new spec (13 -> 20) and #14495's existing case red; the slot-removal case stays green.
🎨 Storybook: ✅ Built — View Storybook🌾 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 2e2885b9b0598676620f93de3d6a21e8da5e87fe
Full docs: ADR-DEVEX-LINT-0015 🎭 Playwright: ✅ 2187 passed, 0 failed📊 Browser Reports
📦 Bundle: 10.1 MB gzipDetailsSummary
Category Glance App Entry Points — 3.89 kBMain entry bundles and manifests
Status: 1 added Graph Workspace — 1.47 MBGraph editor runtime, canvas, workflow orchestration
Status: 3 added Views & Navigation — 135 kBTop-level views, pages, and routed surfaces
Status: 18 added Panels & Settings — 645 kBConfiguration panels, inspectors, and settings screens
Status: 28 added User & Accounts — 53.6 kBAuthentication, profile, and account management bundles
Status: 15 added Editors & Dialogs — 126 kBModals, dialogs, drawers, and in-app editors
Status: 8 added UI Components — 184 kBReusable component library chunks
Status: 18 added Data & Services — 4.11 MBStores, services, APIs, and repositories
Status: 14 added Utilities & Hooks — 586 kBHelpers, composables, and utility bundles
Status: 38 added Vendor & Third-Party — 17.2 MBExternal libraries and shared vendor chunks
Status: 18 added Other — 18.3 MBBundles that do not match a named category
Status: 305 added ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-10-01T14:49:36.373Z",
"gitSha": "899468bde55826888dc85a829ec99c52808b5e52",
"branch": "fix/promoted-widget-demotion-store-ownership",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2014.8770000000127,
"styleRecalcs": 8,
"styleRecalcDurationMs": 2.1220000000000008,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 323.7869999999999,
"heapDeltaBytes": 22236792,
"heapUsedBytes": 75837560,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.5539999999999985,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66611570247934,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2011.1279999999851,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.5349999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 333.308,
"heapDeltaBytes": 277188,
"heapUsedBytes": 68028764,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.828000000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1695.4430000000116,
"styleRecalcs": 73,
"styleRecalcDurationMs": 12.411999999999999,
"layouts": 12,
"layoutDurationMs": 2.873,
"taskDurationMs": 580.426,
"heapDeltaBytes": -2479688,
"heapUsedBytes": 64963468,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 107.09,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665686274509806,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1685.9019999999987,
"styleRecalcs": 73,
"styleRecalcDurationMs": 13.492,
"layouts": 12,
"layoutDurationMs": 3.598,
"taskDurationMs": 608.555,
"heapDeltaBytes": 19503848,
"heapUsedBytes": 73100664,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 112.459,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666336633663366,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.5400000000045,
"styleRecalcs": 32,
"styleRecalcDurationMs": 9.202,
"layouts": 6,
"layoutDurationMs": 1.3169999999999997,
"taskDurationMs": 333.15399999999994,
"heapDeltaBytes": -25608552,
"heapUsedBytes": 76029948,
"domNodes": -199,
"jsHeapTotalBytes": -1310720,
"scriptDurationMs": 9.975999999999999,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666019417475727,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1709.0950000000475,
"styleRecalcs": 31,
"styleRecalcDurationMs": 8.558000000000002,
"layouts": 6,
"layoutDurationMs": 1.1869999999999998,
"taskDurationMs": 282.171,
"heapDeltaBytes": 3283028,
"heapUsedBytes": 70582592,
"domNodes": 53,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.321999999999997,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666019417475724,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 562.4349999999936,
"styleRecalcs": 14,
"styleRecalcDurationMs": 2.841999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 350.095,
"heapDeltaBytes": -6894860,
"heapUsedBytes": 60378172,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 128.911,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667647058823523,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 532.9919999999788,
"styleRecalcs": 12,
"styleRecalcDurationMs": 2.409,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 346.31300000000005,
"heapDeltaBytes": -6931792,
"heapUsedBytes": 60778592,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 124.07099999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665625000000006,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1034.8260000000096,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 641.017,
"heapDeltaBytes": 15413396,
"heapUsedBytes": 84844988,
"domNodes": 0,
"jsHeapTotalBytes": 7503872,
"scriptDurationMs": 47.962,
"eventListeners": 0,
"totalBlockingTimeMs": 419,
"frameDurationMs": 31.312121212121216,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1033.061000000032,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 667.416,
"heapDeltaBytes": 15451620,
"heapUsedBytes": 84663464,
"domNodes": 0,
"jsHeapTotalBytes": 7503872,
"scriptDurationMs": 45.39199999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 411,
"frameDurationMs": 31.309090909090905,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 749.494000000027,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 346.0429999999999,
"heapDeltaBytes": -13033240,
"heapUsedBytes": 81448984,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 112.48199999999997,
"eventListeners": 0,
"totalBlockingTimeMs": 124,
"frameDurationMs": 22.055882352941165,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 747.7329999999824,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 344.15499999999975,
"heapDeltaBytes": -13151340,
"heapUsedBytes": 81315320,
"domNodes": 0,
"jsHeapTotalBytes": 528384,
"scriptDurationMs": 117.08000000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 127,
"frameDurationMs": 22.058823529411764,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "extension-clean-combined-draw",
"durationMs": 7448.7650000000085,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.041000000000001105,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6568.920999999999,
"heapDeltaBytes": -8943844,
"heapUsedBytes": 71543216,
"domNodes": 0,
"jsHeapTotalBytes": -16252928,
"scriptDurationMs": 5098.968,
"eventListeners": 0,
"totalBlockingTimeMs": 50,
"frameDurationMs": 25.808680555555554,
"p95FrameDurationMs": 50
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6413.424999999961,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.2570000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5710.79,
"heapDeltaBytes": -696828,
"heapUsedBytes": 80268336,
"domNodes": 0,
"jsHeapTotalBytes": -16515072,
"scriptDurationMs": 4370.981000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 29,
"frameDurationMs": 24.966536964980545,
"p95FrameDurationMs": 33.400000000000546
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6443.832999999984,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5773.124999999999,
"heapDeltaBytes": -14049924,
"heapUsedBytes": 66644028,
"domNodes": 0,
"jsHeapTotalBytes": -14680064,
"scriptDurationMs": 4441.576999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 90,
"frameDurationMs": 25.392519685039375,
"p95FrameDurationMs": 33.400000000000546
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6588.954999999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6007.009999999999,
"heapDeltaBytes": -9629624,
"heapUsedBytes": 71507584,
"domNodes": 0,
"jsHeapTotalBytes": -16252928,
"scriptDurationMs": 4662.443,
"eventListeners": 0,
"totalBlockingTimeMs": 35,
"frameDurationMs": 25.416988416988417,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "large-graph-idle",
"durationMs": 2007.5279999999793,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.3280000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 448.99,
"heapDeltaBytes": -853740,
"heapUsedBytes": 85047916,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 29.726000000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2006.6020000000435,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.2039999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.1589999999999,
"heapDeltaBytes": -837180,
"heapUsedBytes": 85116752,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 30.564999999999994,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2135.361000000046,
"styleRecalcs": 70,
"styleRecalcDurationMs": 8.948999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1229.088,
"heapDeltaBytes": -4175112,
"heapUsedBytes": 81925208,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 607.5579999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666406249999994,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2150.4449999999906,
"styleRecalcs": 70,
"styleRecalcDurationMs": 8.96,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1253.4019999999998,
"heapDeltaBytes": -8002988,
"heapUsedBytes": 78115036,
"domNodes": 0,
"jsHeapTotalBytes": 1310720,
"scriptDurationMs": 617.3729999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66589147286822,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3195.05700000002,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.628,
"layouts": 60,
"layoutDurationMs": 13.236999999999998,
"taskDurationMs": 1328.254,
"heapDeltaBytes": 8532876,
"heapUsedBytes": 72375916,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 572.9960000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66614583333333,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3294.269999999983,
"styleRecalcs": 64,
"styleRecalcDurationMs": 11.918,
"layouts": 60,
"layoutDurationMs": 15.085999999999999,
"taskDurationMs": 1381.672,
"heapDeltaBytes": 8277288,
"heapUsedBytes": 72616852,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 609.0289999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66548223350254,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2129.0369999999825,
"styleRecalcs": 45,
"styleRecalcDurationMs": 4.967999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1390.099,
"heapDeltaBytes": 7929092,
"heapUsedBytes": 73349480,
"domNodes": 0,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 667.1419999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.798412698412694,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2162.5329999999394,
"styleRecalcs": 44,
"styleRecalcDurationMs": 4.622000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1387.6960000000001,
"heapDeltaBytes": 17026884,
"heapUsedBytes": 81782400,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 663.9499999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.796875,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2042.6350000000184,
"styleRecalcs": 8,
"styleRecalcDurationMs": 2.0689999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.214,
"heapDeltaBytes": -42795156,
"heapUsedBytes": 83157140,
"domNodes": -328,
"jsHeapTotalBytes": -2719744,
"scriptDurationMs": 29.12,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2044.0059999999676,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.256000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.65199999999993,
"heapDeltaBytes": -41659480,
"heapUsedBytes": 83829392,
"domNodes": -328,
"jsHeapTotalBytes": -2195456,
"scriptDurationMs": 28.400999999999996,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 474.37700000000405,
"styleRecalcs": 47,
"styleRecalcDurationMs": 3.915,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 289.963,
"heapDeltaBytes": 9666760,
"heapUsedBytes": 63464400,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 101.122,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66785714285715,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 501.3900000000149,
"styleRecalcs": 47,
"styleRecalcDurationMs": 4.580000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 330.5,
"heapDeltaBytes": -43060108,
"heapUsedBytes": 62479056,
"domNodes": -270,
"jsHeapTotalBytes": -2883584,
"scriptDurationMs": 105.124,
"eventListeners": -204,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379302,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2014.2740000000003,
"styleRecalcs": 9,
"styleRecalcDurationMs": 1.752,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 323.05699999999996,
"heapDeltaBytes": 21973796,
"heapUsedBytes": 75886212,
"domNodes": -248,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 6.571999999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.7700000000368,
"styleRecalcs": 9,
"styleRecalcDurationMs": 1.8209999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 327.53299999999996,
"heapDeltaBytes": 22289164,
"heapUsedBytes": 76041292,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.164999999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66611570247934,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1675.1090000000204,
"styleRecalcs": 75,
"styleRecalcDurationMs": 15.090000000000002,
"layouts": 16,
"layoutDurationMs": 5.061000000000001,
"taskDurationMs": 598.09,
"heapDeltaBytes": -6384860,
"heapUsedBytes": 62543932,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 76.47899999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667326732673263,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1690.0929999999335,
"styleRecalcs": 76,
"styleRecalcDurationMs": 13.562999999999999,
"layouts": 16,
"layoutDurationMs": 4.274,
"taskDurationMs": 598.441,
"heapDeltaBytes": 16643000,
"heapUsedBytes": 79143220,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 76.661,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 868.0039999999849,
"styleRecalcs": 19,
"styleRecalcDurationMs": 22.11199999999999,
"layouts": 5,
"layoutDurationMs": 8.951999999999998,
"taskDurationMs": 693.4420000000001,
"heapDeltaBytes": 22016228,
"heapUsedBytes": 106493104,
"domNodes": 13747,
"jsHeapTotalBytes": 4194304,
"scriptDurationMs": 20.128,
"eventListeners": 2383,
"totalBlockingTimeMs": 105,
"frameDurationMs": 20.153488372093012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8197.634999999991,
"styleRecalcs": 252,
"styleRecalcDurationMs": 27.930000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4381.838999999999,
"heapDeltaBytes": -48258164,
"heapUsedBytes": 74795136,
"domNodes": -328,
"jsHeapTotalBytes": -1708032,
"scriptDurationMs": 1936.308,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665987780040734,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8159.015000000068,
"styleRecalcs": 250,
"styleRecalcDurationMs": 31.589000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4476.993,
"heapDeltaBytes": -38081808,
"heapUsedBytes": 87060352,
"domNodes": -348,
"jsHeapTotalBytes": -1970176,
"scriptDurationMs": 1978.8670000000002,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666053169734152,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 12526.161000000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11902.797999999999,
"heapDeltaBytes": -40353000,
"heapUsedBytes": 168019576,
"domNodes": -3045,
"jsHeapTotalBytes": 6574080,
"scriptDurationMs": 193.227,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 20.756384742951905,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "vue-large-graph-idle",
"durationMs": 12951.000000000022,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12278.571000000002,
"heapDeltaBytes": -25572604,
"heapUsedBytes": 181033192,
"domNodes": -3045,
"jsHeapTotalBytes": 7655424,
"scriptDurationMs": 197.855,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 21.29851973684211,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "vue-large-graph-pan",
"durationMs": 15328.475000000026,
"styleRecalcs": 76,
"styleRecalcDurationMs": 13.490000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14707.117,
"heapDeltaBytes": -34157892,
"heapUsedBytes": 177478472,
"domNodes": -3045,
"jsHeapTotalBytes": 4333568,
"scriptDurationMs": 706.121,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 26.741114982578395,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-large-graph-pan",
"durationMs": 15717.539999999986,
"styleRecalcs": 79,
"styleRecalcDurationMs": 14.113000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15088.135,
"heapDeltaBytes": -23356728,
"heapUsedBytes": 185138304,
"domNodes": -3045,
"jsHeapTotalBytes": 737280,
"scriptDurationMs": 781.545,
"eventListeners": -14915,
"totalBlockingTimeMs": 64,
"frameDurationMs": 27.456893542757417,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "vue-node-resize-workload",
"durationMs": 4454.8139999999985,
"styleRecalcs": 20,
"styleRecalcDurationMs": 61.07899999999999,
"layouts": 20,
"layoutDurationMs": 21.944999999999993,
"taskDurationMs": 4285.237,
"heapDeltaBytes": -5905052,
"heapUsedBytes": 202495304,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 76.404,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 25.28295454545454,
"p95FrameDurationMs": 50
},
{
"name": "vue-node-resize-workload",
"durationMs": 4830.858000000035,
"styleRecalcs": 20,
"styleRecalcDurationMs": 64.334,
"layouts": 20,
"layoutDurationMs": 23.80199999999999,
"taskDurationMs": 4622.280000000001,
"heapDeltaBytes": 20554644,
"heapUsedBytes": 222404260,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 83.53600000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 3,
"frameDurationMs": 27.460227272727273,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6555.313000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6302.089000000001,
"heapDeltaBytes": -37766188,
"heapUsedBytes": 187783080,
"domNodes": -3045,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 102.85300000000002,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 21.26558441558442,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6524.810000000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6240.699000000001,
"heapDeltaBytes": -25102696,
"heapUsedBytes": 180754292,
"domNodes": -3045,
"jsHeapTotalBytes": 4595712,
"scriptDurationMs": 101.11299999999996,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 22.08915254237288,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "workflow-execution",
"durationMs": 105.7700000000068,
"styleRecalcs": 9,
"styleRecalcDurationMs": 11.879000000000001,
"layouts": 4,
"layoutDurationMs": 1.8020000000000003,
"taskDurationMs": 76.28100000000002,
"heapDeltaBytes": 4075180,
"heapUsedBytes": 57489892,
"domNodes": 117,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 9.636999999999999,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 91.11499999994521,
"styleRecalcs": 7,
"styleRecalcDurationMs": 10.473,
"layouts": 4,
"layoutDurationMs": 1.8449999999999998,
"taskDurationMs": 64.977,
"heapDeltaBytes": 3728200,
"heapUsedBytes": 69403148,
"domNodes": 114,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 5.244000000000001,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 515.9909999999854,
"styleRecalcs": 78,
"styleRecalcDurationMs": 77.017,
"layouts": 76,
"layoutDurationMs": 17.742,
"taskDurationMs": 480.879,
"heapDeltaBytes": -17164544,
"heapUsedBytes": 68690272,
"domNodes": 76,
"jsHeapTotalBytes": 11796480,
"scriptDurationMs": 175.96399999999997,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66451612903227,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 476.3100000000122,
"styleRecalcs": 78,
"styleRecalcDurationMs": 74.34100000000001,
"layouts": 76,
"layoutDurationMs": 16.423000000000002,
"taskDurationMs": 440.419,
"heapDeltaBytes": -17517904,
"heapUsedBytes": 68930028,
"domNodes": 76,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 154.511,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.662068965517236,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 870.9570000000895,
"styleRecalcs": 78,
"styleRecalcDurationMs": 199.00799999999998,
"layouts": 76,
"layoutDurationMs": 17.138,
"taskDurationMs": 848.5419999999999,
"heapDeltaBytes": 10460380,
"heapUsedBytes": 129609552,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 253.568,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66603773584906,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 840.7550000000583,
"styleRecalcs": 78,
"styleRecalcDurationMs": 198.698,
"layouts": 76,
"layoutDurationMs": 17.378999999999998,
"taskDurationMs": 798.342,
"heapDeltaBytes": 9935140,
"heapUsedBytes": 128934820,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 233.07899999999998,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666000000000004,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 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. 🧰 Additional context used📚 Code guidelines (4)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC. 📝 WalkthroughWalkthroughThe deferred cleanup for promoted subgraph widgets now removes stored values only when the host input was removed and no remaining input uses the widget ID. Unit and browser tests cover value retention through disconnect and reconnection, and cleanup after input removal. ChangesPromoted widget cleanup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change keeps a promoted widget's edited value when its input is disconnected and reconnected, and frees the stored value only once the input is removed. It adds unit and browser tests for those cases. No merge-blocking risk was identified. 🚥 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 #19761 +/- ##
==========================================
+ Coverage 84.73% 85.46% +0.73%
==========================================
Files 3397 2389 -1008
Lines 163026 136614 -26412
Branches 42490 34933 -7557
==========================================
- Hits 138136 116760 -21376
+ Misses 22966 19491 -3475
+ Partials 1924 363 -1561
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1016 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 7 finding(s).
| Severity | Count |
|---|---|
| 🟡 Medium | 3 |
| 🟢 Low | 4 |
Panel: 8/8 reviewers contributed findings.
| const inputStillPromotable = this.inputs.includes(input) | ||
| if ( | ||
| id && | ||
| !inputStillPromotable && |
There was a problem hiding this comment.
🟡 Medium — inputStillPromotable is implied by the predicate beside it: on an ordinary disconnect input is still in this.inputs carrying widgetId === id (cleared six lines below), so some(i => i.widgetId === id) is already true and deleteWidget was already blocked — the #14495 protection comes from the pre-existing clause, not this one. The only case the new conjunct changes is a slot that survives but no longer carries id (e.g. _setWidget's failed-registration branch), where it suppresses the sole cleanup and leaves an orphaned entry in both widgetValueStore and graphNodeWidgetOrders. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| if ( | ||
| id && | ||
| !inputStillPromotable && | ||
| !this.inputs.some((i) => i.widgetId === id) |
There was a problem hiding this comment.
🟡 Medium — The retained entry is keyed only by graphId:nodeId:inputName, with no record of which interior widget produced it, and registerWidget reuses existing.state.value whenever the type matches. So promoting a different same-typed interior widget onto that host slot after a disconnect silently adopts the previously typed value, which is then serialized and pushed to the interior node at execution; gate the retention on source identity (interior node id + widget name). Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial).
| !inputStillPromotable && | ||
| !this.inputs.some((i) => i.widgetId === id) | ||
| ) { | ||
| useWidgetValueStore().deleteWidget(id) |
There was a problem hiding this comment.
🟡 Medium — Cleanup is decided only inside this disconnect microtask, which then clears input.widgetId, so if the slot is removed in a later tick there is no longer an id to delete and the value/order entry survives for the life of the node. Repeating detach-then-later-remove across unique slot names grows the store unboundedly and leaves values a later same-named input can inherit; the retention policy needs a cleanup hook on slot removal. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).
| // `test.fail()`. Raised as a defect on Comfy-Org/ComfyUI_frontend | ||
| // #19750; the predicate is spelled out here so the next reader does | ||
| // not have to rediscover why. | ||
| const inputStillPromotable = this.inputs.includes(input) |
There was a problem hiding this comment.
🟢 Low — this.inputs.includes(input) tests object identity, which is not a reliable proxy for the logical slot surviving: SubgraphNode.configure() replaces the host input objects, so a reconfigure between the disconnect and this microtask leaves the old input absent and the replacement without widgetId, discarding the retained host value even though the same subgraph slot still exists. Matching on slot name/id would express the intent the comment states. Raised by 1 of 8 reviewers (gpt-5.6-sol-max edge-case).
| // `!this.inputs.some(i => i.widgetId === id)` alone reads as "nothing | ||
| // holds this id", which looks unconditionally true here because | ||
| // `input` is still listed with `widgetId === id` until six lines | ||
| // below. It is not dead code: making it fire on an ordinary |
There was a problem hiding this comment.
🟢 Low — This block argues with a prior review rather than documenting a constraint ("It is not dead code", plus the defect number filed against that reading), which the repo's comment guidance rules out; the mirrored block at SubgraphWidgetPromotion.test.ts:1758 has the same problem. It also misstates the code: it concedes input is still listed with widgetId === id here, which is exactly why the pre-existing some() clause — not the new conjunct — supplies the #14495 protection, so a maintainer who trusts it will preserve a redundant predicate. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| // retaining a value past a teardown that might be undone is the store's stated | ||
| // policy elsewhere too (`releaseNodeWidgets`: "retaining them lets a node that | ||
| // comes back keep what the user set"). | ||
| describe('Promoted widget demotion store ownership', () => { |
There was a problem hiding this comment.
🟢 Low — All three cases pass with inputStillPromotable deleted: the rewire test clears _pendingDemotionToken before the guard runs, and the other two are decided by the pre-existing some(i => i.widgetId === id) term (true while the input is retained, vacuously false once removeInput empties this.inputs). Add a case for the one path the new conjunct actually alters — input still on the node but no longer carrying id — otherwise the suite does not pin what its header claims. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| await test.step('Promote the same slot again', async () => { | ||
| await comfyPage.vueNodes.enterSubgraph(HOST_NODE_ID) | ||
| // Drag from the interior widget's own slot dot rather than from a | ||
| // litegraph slot index: in Vue-node mode the index geometry lands on |
There was a problem hiding this comment.
🟢 Low — This comment records a real product defect — in Vue-node mode a drag targeted by litegraph slot index lands on the neighbouring socket and silently promotes the wrong widget — and the test routes around it instead of covering it. A silent mis-promotion binds the host slot to an unintended interior widget at execution, so it warrants a tracked issue and its own regression test rather than a workaround buried in this spec. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: chromium Recorded test titles:
|
There was a problem hiding this comment.
Verdict: comment. No blocking defects, but the new conjunct never changes the outcome, the new comment describes the guard backwards, and the PR's premise predates #19750's merge.
The retention policy this PR defends is right and is already what main does: an ordinary disconnect keeps the host value, and the entry is freed only when the input has left the node before the deferred demotion runs. Unit case 1 is the one test that fails under the #19750 reorder, and nothing else in the suite catches that, so it earns its place. The rest of the diff can shrink. The predicate can go back to main's one-liner, the 16-line comment fits in three lines, two of the three unit cases reduce to a few lines each, and the e2e spec can reuse SubgraphHelper instead of copying it. Each inline comment carries a suggestion. Applied together, the file passes 53/53 (the rewire case is deleted), case 1 still fails under the reorder, and case 3 still fails when the cleanup is removed.
Pre-merge blockers: none.
Findings without an anchorable line (7)
- P2: the PR's premise is out of date. #19750 merged into
cloud/1.54on 2026-10-03 (merge commita584046), and its final shape does not revert #14495. It clearsinput.widgetIdfirst, then frees only when!this.inputs.includes(input)and no other slot holds the id, behind an earlyif (input._widget !== widget) return, and it ships its own retention test. "Implementing it reverts #14495" describes a review suggestion that never shipped. The table in Review Focus, the source comment, the test header and the spec header all argue against that suggestion. Applying #19750's merged microtask body to this head keeps all 54 tests green, so the new cases do not tellmainandcloud/1.54apart. The two branches now express one policy in two shapes, andmainlacks the_widget !== widgetguard. Please either port the merged shape so the branches match (in that ordering theincludes(input)check is the load-bearing clause, which is what this PR wanted to make readable), or say in the description whymainkeeps its own shape. - P3: Review Focus says "
subgraph.removeInput()reaching theremoving-inputhandler directly does not free the store entry". It does free it.LGraph.removeInputdispatchesremoving-input, which drops the host input, and then callsinput.disconnect()(src/lib/litegraph/src/LGraph.ts:3694-3696). The deferred demotion then finds the input gone and callsdeleteWidget. In a probe at this head the entry was present right afterremoveInputand gone after the microtask. The real gap is removal in a later tick (E3 below), which exists onmaintoo. - P3: Verification says "the slot-removal case stays green under it, so the new tests discriminate the two conditions rather than just tracking the implementation". The slot-removal case is green on
main, under the reorder, and with the new conjunct deleted, so it cannot discriminate anything. Deleting!inputStillPromotable &&leaves all three new cases green. The cases pin retention on disconnect (case 1) and freeing on slot removal (case 3); nothing pins the conjunct. - P3: the description and comments say the #19750 reviewers misread the guard's intent. Before #18074 the deferred check ran after
input.widgetIdwas cleared synchronously (git show 9ee67cb17b^:src/lib/litegraph/src/subgraph/SubgraphNode.ts, L338-348), so the guard freed the entry on every ordinary disconnect. Their reading was the original intent. Retention arrived when #18074 moved the clear below the check, and that same commit took the #14495 e2e case offtest.fail(). The policy is still right; the history should say it came from #18074. - Nit (P3): the title prefix is
test:but the diff changesSubgraphNode.ts. If the predicate goes back tomain's line and only the comment changes,test:fits; otherwise usefix:orrefactor:. - Nit (P3): the body runs to several hundred words of Review Focus with bold emphasis, against the repository's "extremely concise and information-dense" PR guideline. Two sentences on the policy, links to #14495, #18074 and #19750, and the mutation result carry the content.
- Nit (P3):
subgraphPromotedWidgetDemotionCleanup.spec.tsnames the opposite of what the spec pins. It proves the entry is not cleaned up across a re-promotion. A name likesubgraphPromotedWidgetRepromotionKeepsHostValue.spec.tsmatches the describe title.
Existing findings confirmed or contested (7, github-actions panel at this head)
SubgraphNode.ts:379(redundant conjunct, orphan via_setWidgetfailure): I confirm the redundancy and contest the orphan. Deleting the conjunct leaves every test green. The two predicates differ only wheninputis still listed withoutwidgetId === id._setWidget's failure branch reaches that state only whenregisterWidgetrejects the id, which happens only for an un-keyable id (src/stores/widgetValueStore.ts:238). The id there is rebuilt from the same graph id, node id and slot name that produced a keyable one. I traced every writer ofinput.widgetIdinsrc/and found none that produces the state inside the microtask window. "Behaviour-identical" holds for in-repo paths. The fix is the inline suggestion on L376-381.SubgraphNode.ts:380(name-keyed entry adopted by a different same-typed widget): I confirm the mechanism, but it predates this PR.registerWidgetreusesexisting.state.valueon a type match identically on the base commit2e2885b, and this diff does not change it. It belongs in a follow-up, not here.SubgraphNode.ts:382(later-tick removal leaks the entry): confirmed, and it predates this PR. In a probe, detaching, letting the microtask run and then removing the slot left the entry (value=99), and a re-added slot with the same name inherited it.mainbehaves the same. The new comment's "free it once this input is gone" overclaims because of this; my suggestion on L360-375 words it as "removed before this runs".SubgraphNode.ts:376(includes(input)identity vsconfigure()): contested. Aconfigure()between the disconnect and the microtask drops the entry on head and on base alike, because the replacement inputs carry nowidgetId, sosome()frees it either way. The conjunct is not the cause.SubgraphNode.ts:371(comment argues with a prior review and misstates which clause protects #14495): confirmed. On top of that, the comment inverts the predicate's truth value and cites a stale line distance. See the inline comments on L360-375 and on the test header at L1756-1775.SubgraphWidgetPromotion.test.ts:1776(all three cases pass with the conjunct deleted): confirmed by running it (3 passed). Item 3 above covers the description claim that depends on it.subgraphPromotedWidgetDemotionCleanup.spec.ts:89(comment records aconnectFromInputdefect): confirmed as a record of a defect in a shared helper thatrebindPromotedInputstill uses. See the inline comment on L88-90. I have not reproduced the Vue-mode misdrop.
Unverified (1)
- The e2e rows of the Review Focus table (the #14495 rebind case and the new spec going red under the reorder). I did not run Playwright. CI's Playwright run at this head passed 2187 tests including the new spec. To settle it, run
subgraphPromotion.spec.ts"Promoted STRING widget edit survives a rebind of the interior link" and the new spec with the predicate changed to!this.inputs.some((i) => i !== input && i.widgetId === id).
Checked and cleared (3)
- Deleting the e2e spec as redundant with unit case 1 and the existing rebind case. I kept it. The description states its purpose (the gap includes leaving and re-entering the subgraph). A regression that cleaned up demoted entries on navigation would pass unit case 1 and the same-view rebind case, but fail this spec.
- The
input-addedexisting-input path calling_setWidgetwithout clearing_pendingDemotionToken. It is the same on the base commit, so this PR did not introduce it. window.app!,throw new Errorinsidepage.evaluate, andas constin the spec.browser_tests/README.md:603allows the non-null assertion in E2E code, and the rest matchesSubgraphHelper's own pattern.
Coverage
- Depth standard. Lanes run: correctness, maintainability, idiomaticity, tests, documentation. None skipped.
- Lenses: blast-radius, regression-risk, idempotency, shared-state, boundary and root-cause principles (correctness); ponytail, no-comments, minimize-reader-load, subtract-before-you-add, laziness, migrate-callers (maintainability); typescript-best-practices, type-system-discipline (idiomaticity); designing-test-suites, reviewing-playwright-specs, test-mock-quality, consolidating-test-setup, prove-it-works (tests); technical-writing (documentation).
- No-comments inventory: the diff adds 8 comment blocks, and each one has an inline comment above.
- Run at
bf37ba9:vitest run SubgraphWidgetPromotion.test.ts54/54. Mutations: conjunct deleted (new cases 3/3 green); #19750 reorder (only case 1 fails; the whole file otherwise green); no token cancel (L221, L1706 and the rewire case fail); cleanup removed (only case 3 fails). All suggestions applied: 53/53, oxfmt and eslint clean (pre-existing layer warnings only). CI: 110 success, 29 skipped, 0 failed. Fallow: no new findings. - Not run: Playwright (CI covers it),
pnpm typecheck(CI green; the suggestions only remove code or reuse helpers already imported in the file).
| const inputStillPromotable = this.inputs.includes(input) | ||
| if ( | ||
| id && | ||
| !inputStillPromotable && | ||
| !this.inputs.some((i) => i.widgetId === id) | ||
| ) { |
There was a problem hiding this comment.
P2: inputStillPromotable never changes the outcome on any path in this repository. On an ordinary disconnect input is still in this.inputs with widgetId === id (it is cleared at L387), so this.inputs.some((i) => i.widgetId === id) is already true and nothing is freed. When the input has been removed, includes(input) is false and the result again comes from some(). The two disagree only when input is still listed but no longer carries id, and no in-repo writer produces that inside the microtask window: _setWidget's failure branch needs registerWidget to reject the id, which it does only for an un-keyable id (widgetValueStore.ts:238), and this id is rebuilt from the same parts.
Deleting the conjunct leaves all 54 tests in SubgraphWidgetPromotion.test.ts green, the three new ones included, so it is a second condition nothing exercises. main's line already means "free only once the input is gone"; the comment above can say that (see my suggestion on L360-375).
| const inputStillPromotable = this.inputs.includes(input) | |
| if ( | |
| id && | |
| !inputStillPromotable && | |
| !this.inputs.some((i) => i.widgetId === id) | |
| ) { | |
| if (id && !this.inputs.some((i) => i.widgetId === id)) { |
| // Free the widget state only once this input is gone from the node -- | ||
| // i.e. its slot was removed in the same tick as the disconnect, so | ||
| // nothing can promote it again. While the input survives, a | ||
| // disconnect is a demotion the user can reverse by reconnecting, and | ||
| // #14495 requires the value they typed on the *host* to still be | ||
| // there when they do, rather than reverting to the interior node's | ||
| // older value. | ||
| // | ||
| // `!this.inputs.some(i => i.widgetId === id)` alone reads as "nothing | ||
| // holds this id", which looks unconditionally true here because | ||
| // `input` is still listed with `widgetId === id` until six lines | ||
| // below. It is not dead code: making it fire on an ordinary | ||
| // disconnect reverts #14495, whose e2e case #18074 flipped off | ||
| // `test.fail()`. Raised as a defect on Comfy-Org/ComfyUI_frontend | ||
| // #19750; the predicate is spelled out here so the next reader does | ||
| // not have to rediscover why. |
There was a problem hiding this comment.
P3: This block narrates the #19750 review rather than the constraint, and three of its statements do not match the code:
- L368-370 says
!this.inputs.some(...)"looks unconditionally true". On an ordinary disconnect it is always false, and that is why the host value survives. - "until six lines below" was
main's spacing;input.widgetId = undefinedis now at L387. - "its slot was removed in the same tick as the disconnect" is narrower than the guard. A removal, or a
configure()that replaces the input objects, at any point before this microtask runs also frees the entry. A removal in a later tick never does (that leak exists onmaintoo).
Three lines carry the constraint. The review history belongs in the PR description.
| // Free the widget state only once this input is gone from the node -- | |
| // i.e. its slot was removed in the same tick as the disconnect, so | |
| // nothing can promote it again. While the input survives, a | |
| // disconnect is a demotion the user can reverse by reconnecting, and | |
| // #14495 requires the value they typed on the *host* to still be | |
| // there when they do, rather than reverting to the interior node's | |
| // older value. | |
| // | |
| // `!this.inputs.some(i => i.widgetId === id)` alone reads as "nothing | |
| // holds this id", which looks unconditionally true here because | |
| // `input` is still listed with `widgetId === id` until six lines | |
| // below. It is not dead code: making it fire on an ordinary | |
| // disconnect reverts #14495, whose e2e case #18074 flipped off | |
| // `test.fail()`. Raised as a defect on Comfy-Org/ComfyUI_frontend | |
| // #19750; the predicate is spelled out here so the next reader does | |
| // not have to rediscover why. | |
| // `input` still carries `id` until it is cleared below, so a plain | |
| // disconnect keeps the host value for re-promotion (#14495). The | |
| // entry is freed only if the input was removed before this runs. |
| // Who owns freeing a demoted promoted widget's store entry, and who must not. | ||
| // | ||
| // Reviewers of the cloud/1.54 carrier for #18074 (frontend #19750) read the | ||
| // deferred demotion's `!this.inputs.some(i => i.widgetId === id)` guard as | ||
| // meaning "nothing else holds this id, so free it", concluded it was dead | ||
| // because the input being demoted is still in `this.inputs` carrying the id, | ||
| // and proposed clearing `input.widgetId` before the check. That reading is | ||
| // wrong about the intent, and implementing it reverts #14495: the host's | ||
| // edited value is kept across a disconnect precisely so that re-promoting the | ||
| // same slot restores what the user typed instead of reverting to the interior | ||
| // node's older value. #18074 flipped that issue's e2e case from `test.fail()` | ||
| // on the strength of this. | ||
| // | ||
| // What the guard actually means -- and what these tests pin -- is "free it once | ||
| // the input itself is gone from the node", which only happens when the slot is | ||
| // removed in the same tick as the disconnect. Explicit un-promote | ||
| // (`demotePromotedInput`) frees the entry synchronously on its own path, and | ||
| // retaining a value past a teardown that might be undone is the store's stated | ||
| // policy elsewhere too (`releaseNodeWidgets`: "retaining them lets a node that | ||
| // comes back keep what the user set"). |
There was a problem hiding this comment.
P3: This header retells the #19750 review and the #18074 history. The test names below already say what is pinned. The history belongs in the PR description, and it needs the correction in my review body: before #18074 this guard did free the entry on every ordinary disconnect.
| // Who owns freeing a demoted promoted widget's store entry, and who must not. | |
| // | |
| // Reviewers of the cloud/1.54 carrier for #18074 (frontend #19750) read the | |
| // deferred demotion's `!this.inputs.some(i => i.widgetId === id)` guard as | |
| // meaning "nothing else holds this id, so free it", concluded it was dead | |
| // because the input being demoted is still in `this.inputs` carrying the id, | |
| // and proposed clearing `input.widgetId` before the check. That reading is | |
| // wrong about the intent, and implementing it reverts #14495: the host's | |
| // edited value is kept across a disconnect precisely so that re-promoting the | |
| // same slot restores what the user typed instead of reverting to the interior | |
| // node's older value. #18074 flipped that issue's e2e case from `test.fail()` | |
| // on the strength of this. | |
| // | |
| // What the guard actually means -- and what these tests pin -- is "free it once | |
| // the input itself is gone from the node", which only happens when the slot is | |
| // removed in the same tick as the disconnect. Explicit un-promote | |
| // (`demotePromotedInput`) frees the entry synchronously on its own path, and | |
| // retaining a value past a teardown that might be undone is the store's stated | |
| // policy elsewhere too (`releaseNodeWidgets`: "retaining them lets a node that | |
| // comes back keep what the user set"). |
| function makeInteriorNode(title: string, value: WidgetValue = 1) { | ||
| const node = new LGraphNode(title) | ||
| const input = node.addInput('value', 'number') | ||
| node.addOutput('out', 'number') | ||
| const widget: LegacyWidget = new LegacyWidget({ | ||
| name: 'widget', | ||
| type: 'number', | ||
| value, | ||
| y: 0, | ||
| options: {}, | ||
| node | ||
| }) | ||
| node.widgets = [widget] | ||
| input.widget = { name: widget.name } | ||
| return { node, widget } | ||
| } | ||
|
|
||
| function createPromotedHost() { | ||
| const subgraph = createTestSubgraph({ | ||
| inputs: [{ name: 'value', type: 'number' }] | ||
| }) | ||
| const interior = makeInteriorNode('InteriorNode', 1) | ||
| subgraph.add(interior.node) | ||
| subgraph.inputNode.slots[0].connect(interior.node.inputs[0], interior.node) | ||
|
|
||
| const hostNode = createTestSubgraphNode(subgraph) | ||
| const promotedId = hostNode.inputs[0].widgetId | ||
| if (!promotedId) throw new Error('expected the input to be promoted') | ||
|
|
||
| return { subgraph, interior, hostNode, promotedId } | ||
| } |
There was a problem hiding this comment.
P3: makeInteriorNode is the third copy of this builder in the file (the file-level createNodeWithWidget at L54 and the sibling describe's makeInteriorNode at L1689), and the add-then-connect-then-create sequence is setupPromotedWidget at L80. The returned widget is never read. Built on the existing helpers, all three cases still pass; the interior value becomes 42 instead of 1, which no case depends on.
| function makeInteriorNode(title: string, value: WidgetValue = 1) { | |
| const node = new LGraphNode(title) | |
| const input = node.addInput('value', 'number') | |
| node.addOutput('out', 'number') | |
| const widget: LegacyWidget = new LegacyWidget({ | |
| name: 'widget', | |
| type: 'number', | |
| value, | |
| y: 0, | |
| options: {}, | |
| node | |
| }) | |
| node.widgets = [widget] | |
| input.widget = { name: widget.name } | |
| return { node, widget } | |
| } | |
| function createPromotedHost() { | |
| const subgraph = createTestSubgraph({ | |
| inputs: [{ name: 'value', type: 'number' }] | |
| }) | |
| const interior = makeInteriorNode('InteriorNode', 1) | |
| subgraph.add(interior.node) | |
| subgraph.inputNode.slots[0].connect(interior.node.inputs[0], interior.node) | |
| const hostNode = createTestSubgraphNode(subgraph) | |
| const promotedId = hostNode.inputs[0].widgetId | |
| if (!promotedId) throw new Error('expected the input to be promoted') | |
| return { subgraph, interior, hostNode, promotedId } | |
| } | |
| function createPromotedHost() { | |
| const subgraph = createTestSubgraph({ | |
| inputs: [{ name: 'value', type: 'number' }] | |
| }) | |
| const interior = createNodeWithWidget('InteriorNode') | |
| const hostNode = setupPromotedWidget(subgraph, interior.node) | |
| const promotedId = hostNode.inputs[0].widgetId | |
| if (!promotedId) throw new Error('expected the input to be promoted') | |
| return { subgraph, interior, hostNode, promotedId } | |
| } |
| it('keeps the host value across an ordinary disconnect so re-promoting the slot restores it', async () => { | ||
| const { subgraph, interior, hostNode, promotedId } = createPromotedHost() | ||
| const store = useWidgetValueStore() | ||
|
|
||
| // The host-side edit #14495 is about: typed on the subgraph node, not on | ||
| // the interior node, which still holds its own older value. | ||
| store.setValue(promotedId, 99) | ||
|
|
||
| interior.node.disconnectInput(0, true) | ||
| await Promise.resolve() | ||
|
|
||
| // Demoted: no widget on the host, and the input no longer claims an id... | ||
| expect(hostNode.inputs[0].widgetId).toBeUndefined() | ||
| expect(hostNode.widgets).toHaveLength(0) | ||
| // ...but the value survives, because the input itself is still on the node | ||
| // and the user can put the link back. | ||
| expect(store.getWidget(promotedId)?.value).toBe(99) | ||
|
|
||
| subgraph.inputNode.slots[0].connect(interior.node.inputs[0], interior.node) | ||
| await Promise.resolve() | ||
|
|
||
| expect(hostNode.inputs[0].widgetId).toBe(promotedId) | ||
| expect(store.getWidget(promotedId)?.value).toBe(99) | ||
| }) |
There was a problem hiding this comment.
P3: Only the final read carries this case's falsifier; under the #19750 reorder it fails with expected 1 to be 99. The demotion assertions repeat what earlier tests in this file pin, the mid-way value check is implied by the final one, and the three comments restate the test name or the next assertion.
Reading the value through the host input with promotedWidgetStateByName also proves the reconnect re-promoted the slot. store.getWidget(promotedId) does not: a retained entry reads 99 even if re-promotion never happens. This version fails under the reorder and passes at head.
| it('keeps the host value across an ordinary disconnect so re-promoting the slot restores it', async () => { | |
| const { subgraph, interior, hostNode, promotedId } = createPromotedHost() | |
| const store = useWidgetValueStore() | |
| // The host-side edit #14495 is about: typed on the subgraph node, not on | |
| // the interior node, which still holds its own older value. | |
| store.setValue(promotedId, 99) | |
| interior.node.disconnectInput(0, true) | |
| await Promise.resolve() | |
| // Demoted: no widget on the host, and the input no longer claims an id... | |
| expect(hostNode.inputs[0].widgetId).toBeUndefined() | |
| expect(hostNode.widgets).toHaveLength(0) | |
| // ...but the value survives, because the input itself is still on the node | |
| // and the user can put the link back. | |
| expect(store.getWidget(promotedId)?.value).toBe(99) | |
| subgraph.inputNode.slots[0].connect(interior.node.inputs[0], interior.node) | |
| await Promise.resolve() | |
| expect(hostNode.inputs[0].widgetId).toBe(promotedId) | |
| expect(store.getWidget(promotedId)?.value).toBe(99) | |
| }) | |
| it('keeps the host value across an ordinary disconnect so re-promoting the slot restores it', async () => { | |
| const { subgraph, interior, hostNode, promotedId } = createPromotedHost() | |
| useWidgetValueStore().setValue(promotedId, 99) | |
| interior.node.disconnectInput(0, true) | |
| await Promise.resolve() | |
| subgraph.inputNode.slots[0].connect(interior.node.inputs[0], interior.node) | |
| expect(promotedWidgetStateByName(hostNode, 'value').value).toBe(99) | |
| }) |
| ) | ||
| await comfyPage.subgraph.exitViaBreadcrumb() | ||
|
|
||
| await expect(hostWidget).toBeVisible() |
There was a problem hiding this comment.
Nit (P3): the toHaveValue below already waits for the input inside hostWidget, and setInputNumberValue has to interact with it anyway, so this visibility check adds nothing.
| await expect(hostWidget).toBeVisible() |
| await expect( | ||
| comfyPage.vueNodes.getInputNumberControls(hostWidget).input | ||
| ).toHaveValue(INTERIOR_VALUE) |
There was a problem hiding this comment.
P3: This asserts fixture data (the interior KSampler's steps is 20), not behavior. setInputNumberValue already checks its own write, and the final assertion is what tells 13 apart from a reseeded value. Delete it together with INTERIOR_VALUE at L20 (separate suggestion).
| await expect( | |
| comfyPage.vueNodes.getInputNumberControls(hostWidget).input | |
| ).toHaveValue(INTERIOR_VALUE) |
| const HOST_NODE_ID = '2' | ||
| const INTERIOR_KSAMPLER_ID = '1' | ||
| const PROMOTED_WIDGET = 'steps' | ||
| const INTERIOR_VALUE = '20' |
There was a problem hiding this comment.
P3: Unused once the premise check at L60-62 goes; delete it with that suggestion.
| const INTERIOR_VALUE = '20' |
| // Drag from the interior widget's own slot dot rather than from a | ||
| // litegraph slot index: in Vue-node mode the index geometry lands on | ||
| // the neighbouring socket and silently promotes the wrong widget. |
There was a problem hiding this comment.
P3: This comment records a defect in a shared fixture: SubgraphHelper.connectFromInput resolves the wrong socket in Vue-node mode. rebindPromotedInput still calls it, and the @vue-nodes #14495 case in subgraphPromotion.spec.ts goes through that helper, so other specs can still silently promote the wrong widget. I have not reproduced the misdrop myself. Please fix the helper or file an issue and link it here, rather than leave this workaround as the only record. No suggestion block, because the fix lives in SubgraphHelper.ts.
| const ksampler = await comfyPage.vueNodes.getFixtureByTitle('KSampler') | ||
| const fromSlot = ksampler.getSlot(PROMOTED_WIDGET) | ||
| const toPosition = await comfyPage.subgraph | ||
| .getInputSlot(PROMOTED_WIDGET) | ||
| .getPosition() | ||
| await fromSlot.dragTo(comfyPage.canvas, { targetPosition: toPosition }) | ||
| await expect | ||
| .poll(() => comfyPage.vueNodes.isSlotConnected(fromSlot)) | ||
| .toBe(true) |
There was a problem hiding this comment.
P3: This drag-from-widget-slot recipe (getFixtureByTitle, getSlot, subgraph.getInputSlot(...).getPosition(), dragTo(comfyPage.canvas), then polling isSlotConnected) now appears four times: here, subgraphPromotion.spec.ts:719-726 and :805-812, and subgraphSlots.spec.ts:665. A SubgraphHelper method would give it one home and could replace the connectFromInput path the comment above warns about. No suggestion block, because it spans files.
Summary
The guard that frees a demoted promoted widget's
widgetValueStoreentry reads as dead code and was reported as such on #19750; it is not dead, and the proposed repair reverts #14495 — this PR spells the condition out and adds the regression coverage that was missing on both sides of it.Changes
SubgraphNode.ts— the deferred demotion's store-cleanup predicate now states the condition it actually encodes (this.inputs.includes(input): free the entry only once the input is gone from the node), with a comment recording why firing it on an ordinary disconnect is wrong. Behaviour-identical tomain.SubgraphWidgetPromotion.test.ts— three cases pinning store ownership: the host value survives an ordinary disconnect and a later reconnect; a same-tick rewire keeps the entry; removing the slot in the same tick as the disconnect frees it.subgraphPromotedWidgetDemotionCleanup.spec.ts— new black-box case for Regression: edits to a promoted STRING widget on a subgraph host node are not written back into the subgraph; value reverts on disconnect/reconnect #14495 across a wider gap than its own case covers.Review Focus
This started as a bug repair and the reproduction overturned the premise. Please check the reasoning, not just the diff.
Reviewers of #19750 (the
cloud/1.54carrier for #18074) raised, at High severity and with 6 of 8 reviewers agreeing, that inSubgraphNode'sinput-disconnectedhandler:the predicate is always true —
inputis still inthis.inputscarryingid— sodeleteWidgetnever runs on a genuine disconnect, and the fix is to clearinput.widgetIdbefore the check. That reading of the mechanism is correct. Implementing it reverts #14495.Measured on
2e2885b9b0, with the suggested reordering applied:subgraphPromotion.spec.ts→ Promoted STRING widget edit survives a rebind of the interior link (the case #18074 flipped offtest.fail()to close #14495)promoted-value-rebind-test""13then detach / leave / return / re-promote1320(the interior node's older value)99across a disconnect99Keeping the entry past the demotion is the mechanism that satisfies #14495: the value the user typed on the host must still be there when they put the link back, instead of reverting to the interior node's value. The store states the same policy elsewhere —
releaseNodeWidgets: "retaining them lets a node that comes back keep what the user set".The guard does have one live case, confirmed by the new unit test: when the slot is removed in the same tick as the disconnect,
inputis no longer inthis.inputs, nothing can promote it again, and the entry is freed. So the condition is "free it once the input is gone", which is what this PR writes down.What this PR therefore does not do: free the entry on an ordinary disconnect. If the product decision is that it should — that a disconnect discards the host-side edit — that is a deliberate reversal of #14495 and needs the issue reopened, not a quiet guard change. Flagging rather than deciding.
Two adjacent things found and deliberately left alone:
_pendingDemotionTokenclear; token not cleared byconfigure/onRemoved/removing-input) are untouched here.subgraph.removeInput()reaching theremoving-inputhandler directly does not free the store entry. Explicit un-promote (demotePromotedInput) does, synchronously, so this is latent rather than a live symptom.Also worth knowing for anyone writing promotion e2e:
SubgraphHelper.connectFromInput(node, slotIndex, name)lands on the neighbouring socket in Vue-node mode (it promotedseedthrough thestepsslot —aria-valuemax2^64 gave it away). The new spec drags from the interior widget's own slot dot instead.Verification
Node 26, branch head:
NODE_OPTIONS=--no-experimental-webstorage pnpm exec vitest run src/lib/litegraph/src/subgraph/ src/core/graph/subgraph/ src/stores/widgetValueStore.test.ts src/stores/domWidgetStore.test.ts src/composables/graph/useErrorClearingHooks.test.ts src/renderer/extensions/vueNodes/widgets/utils/multilineTextarea.promoted.test.ts— 34 files, 626 passed.pnpm exec playwright test browser_tests/tests/subgraph/subgraphPromotion.spec.ts browser_tests/tests/subgraph/subgraphPromotedWidgetRewireDuplication.spec.ts browser_tests/tests/subgraph/subgraphPromotedWidgetDemotionCleanup.spec.ts --project=chromium— 28 passed (2.5m), against a local devtools-mounted CI backend container.pnpm typecheck:app,pnpm typecheck:browser, oxlint, eslint, oxfmt — clean (pre-commit ran all of them).One flake observed and not caused by this change:
subgraphPromotedWidgetRewireDuplication.spec.ts→ undo restores exactly one of each promoted widget failed once in a 28-test parallel run, then passed 3/3 in isolation and in a clean re-run of the same 28.