Repository navigation
fix(widgets): refuse on whether the name could be written, not on the read-back - #20104
Conversation
… read-back The unique-name invariant removed a widget whenever a rename did not read back. `BaseWidget.set name` delegates to `widgetValueStore.renameWidget()` and returns without changing the name whenever the store declines — which it does when the node has no entries, exactly the state an ambiguous pair leaves a node in and the state a node is in after it has been removed from the graph. So the read-back reports failure for an ordinary, fully renamable widget, and removing on it destroyed that widget. Measured on the parent commit through the real app: a node deleted and re-added comes back one widget short and saves **one** `widgets_values` entry for a two-widget node. Positional widget addressing reads that arity, so a dropped slot shifts every later widget. The read-back still decides whether the pair is reported; `nameIsWritable` now decides whether the widget is removed, and it is deliberately the same predicate `ensureUniqueWidgetNames` uses to decide it may rename at all — `setNodeId` gates registration on that, so two copies of the rule disagreeing is a widget destroyed over a disagreement. The predicate is extracted rather than duplicated. A pair the node keeps is reported under a third stable errorType, `widget_duplicate_name_unresolved`, so the ambiguity stays observable without being paid for in user data. A widget whose name genuinely cannot be written is still removed, and that proof is unchanged. Not fixed here, and called out in the spec so it is not mistaken for correct: re-registering an ambiguous pair routes the second widget's `name` setter through `renameWidget` on a stale `_state.nodeId`, which hands it the first widget's store entry, so both read the first widget's value. That is a separate pre-existing defect in `BaseWidget.set name`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎨 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 9d9cfa4fc9084947b501611a5a97792567be46d6
Full docs: ADR-DEVEX-LINT-0015 📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-10-04T20:44:06.360Z",
"gitSha": "f644c900fa6b38572c0ee5c4834f8e5ba09b7346",
"branch": "op451-widget-refusal-criterion",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2010.4750000000422,
"styleRecalcs": 12,
"styleRecalcDurationMs": 2.500999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 286.817,
"heapDeltaBytes": 518800,
"heapUsedBytes": 68367024,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.910999999999994,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2009.2089999999416,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.044,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 298.211,
"heapDeltaBytes": 486828,
"heapUsedBytes": 68224292,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 8.629999999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66611570247934,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1677.4869999999282,
"styleRecalcs": 71,
"styleRecalcDurationMs": 12.011000000000001,
"layouts": 12,
"layoutDurationMs": 3.235,
"taskDurationMs": 522.5139999999999,
"heapDeltaBytes": -2150348,
"heapUsedBytes": 66145080,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 95.07000000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667326732673267,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1690.2249999999412,
"styleRecalcs": 72,
"styleRecalcDurationMs": 13.762,
"layouts": 12,
"layoutDurationMs": 3.542,
"taskDurationMs": 543.869,
"heapDeltaBytes": -2423752,
"heapUsedBytes": 65387008,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 99.79299999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666336633663366,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1710.5470000000196,
"styleRecalcs": 31,
"styleRecalcDurationMs": 6.804,
"layouts": 6,
"layoutDurationMs": 1.047,
"taskDurationMs": 246.39500000000004,
"heapDeltaBytes": 3421672,
"heapUsedBytes": 70755068,
"domNodes": 53,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 9.374999999999995,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665048543689316,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1734.2720000000327,
"styleRecalcs": 31,
"styleRecalcDurationMs": 8.45,
"layouts": 6,
"layoutDurationMs": 1.2819999999999998,
"taskDurationMs": 255.231,
"heapDeltaBytes": 3423056,
"heapUsedBytes": 71711020,
"domNodes": 53,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 11.284,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665384615384614,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 551.5550000000076,
"styleRecalcs": 15,
"styleRecalcDurationMs": 3.346999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 337.659,
"heapDeltaBytes": -7461080,
"heapUsedBytes": 61061772,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 121.991,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663636363636353,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 549.6149999999034,
"styleRecalcs": 15,
"styleRecalcDurationMs": 3.0300000000000016,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 331.686,
"heapDeltaBytes": -7091480,
"heapUsedBytes": 61646580,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 119.04599999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 954.2460000000119,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 562.1690000000001,
"heapDeltaBytes": 38246816,
"heapUsedBytes": 107854648,
"domNodes": 0,
"jsHeapTotalBytes": 2260992,
"scriptDurationMs": 37.72099999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 343,
"frameDurationMs": 28.787878787878775,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 967.467000000056,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 587.11,
"heapDeltaBytes": 15342832,
"heapUsedBytes": 85341012,
"domNodes": 0,
"jsHeapTotalBytes": 3833856,
"scriptDurationMs": 39.80299999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 352,
"frameDurationMs": 29.293939393939404,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 718.1839999999511,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 283.64199999999994,
"heapDeltaBytes": 17282324,
"heapUsedBytes": 104101944,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 89.17100000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 99,
"frameDurationMs": 21.073529411764707,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 734.1370000000325,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 288.45400000000024,
"heapDeltaBytes": 17294700,
"heapUsedBytes": 103481520,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 91.144,
"eventListeners": 0,
"totalBlockingTimeMs": 99,
"frameDurationMs": 20.951428571428576,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "extension-clean-combined-draw",
"durationMs": 5886.900000000082,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.0519999999999992,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5133.168000000001,
"heapDeltaBytes": -3779868,
"heapUsedBytes": 80750064,
"domNodes": -143,
"jsHeapTotalBytes": -10883072,
"scriptDurationMs": 4033.6680000000006,
"eventListeners": -82,
"totalBlockingTimeMs": 50,
"frameDurationMs": 23.096062992125983,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "extension-clean-combined-draw",
"durationMs": 5710.218999999938,
"styleRecalcs": 3,
"styleRecalcDurationMs": 0.8789999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4981.621999999999,
"heapDeltaBytes": -898356,
"heapUsedBytes": 69348328,
"domNodes": -142,
"jsHeapTotalBytes": -11145216,
"scriptDurationMs": 3839.764,
"eventListeners": -74,
"totalBlockingTimeMs": 0,
"frameDurationMs": 22.352156862745094,
"p95FrameDurationMs": 33.400000000000546
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6107.234999999946,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.0760000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5275.261,
"heapDeltaBytes": -14386560,
"heapUsedBytes": 71058680,
"domNodes": -142,
"jsHeapTotalBytes": -5902336,
"scriptDurationMs": 4108.531,
"eventListeners": -74,
"totalBlockingTimeMs": 0,
"frameDurationMs": 23.826953125,
"p95FrameDurationMs": 33.400000000000546
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 5961.366999999996,
"styleRecalcs": 4,
"styleRecalcDurationMs": 0.9449999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5135.407000000001,
"heapDeltaBytes": -482752,
"heapUsedBytes": 85002668,
"domNodes": -172,
"jsHeapTotalBytes": -2494464,
"scriptDurationMs": 4013.540000000001,
"eventListeners": -82,
"totalBlockingTimeMs": 23,
"frameDurationMs": 23.770916334661354,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "large-graph-idle",
"durationMs": 2009.2829999999822,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.5190000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 350.18299999999994,
"heapDeltaBytes": -10051252,
"heapUsedBytes": 78730132,
"domNodes": 0,
"jsHeapTotalBytes": 36864,
"scriptDurationMs": 27.042000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760327,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2009.808000000021,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.3279999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 342.9249999999999,
"heapDeltaBytes": -11939652,
"heapUsedBytes": 68226076,
"domNodes": 0,
"jsHeapTotalBytes": 36864,
"scriptDurationMs": 28.824999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66528925619835,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2099.064999999996,
"styleRecalcs": 69,
"styleRecalcDurationMs": 11.254,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1089.667,
"heapDeltaBytes": -19506640,
"heapUsedBytes": 70473968,
"domNodes": 0,
"jsHeapTotalBytes": 1085440,
"scriptDurationMs": 558.328,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665599999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2120.542999999998,
"styleRecalcs": 70,
"styleRecalcDurationMs": 11.996000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1135.69,
"heapDeltaBytes": -9930084,
"heapUsedBytes": 79336552,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 582.352,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666141732283464,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3222.3299999999426,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.167000000000002,
"layouts": 60,
"layoutDurationMs": 15.416,
"taskDurationMs": 1253.68,
"heapDeltaBytes": 1265080,
"heapUsedBytes": 69920392,
"domNodes": 24,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 570.126,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66528497409326,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3238.872000000015,
"styleRecalcs": 72,
"styleRecalcDurationMs": 14.831,
"layouts": 60,
"layoutDurationMs": 16.205000000000002,
"taskDurationMs": 1322.747,
"heapDeltaBytes": 1227340,
"heapUsedBytes": 69559476,
"domNodes": 24,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 606.4689999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665463917525773,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "legacy-node-drag",
"durationMs": 2192.5249999999323,
"styleRecalcs": 47,
"styleRecalcDurationMs": 7.572000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1364.261,
"heapDeltaBytes": 6727752,
"heapUsedBytes": 76133556,
"domNodes": 0,
"jsHeapTotalBytes": 1572864,
"scriptDurationMs": 688.483,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.794615384615383,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2172.370000000001,
"styleRecalcs": 48,
"styleRecalcDurationMs": 7.398,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1312.893,
"heapDeltaBytes": 6880272,
"heapUsedBytes": 75945900,
"domNodes": 0,
"jsHeapTotalBytes": 1572864,
"scriptDurationMs": 669.359,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.794573643410853,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2015.7480000000305,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.1459999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 343.744,
"heapDeltaBytes": -9695040,
"heapUsedBytes": 80433824,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 28.042000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2020.061999999939,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.416,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 347.778,
"heapDeltaBytes": -8765172,
"heapUsedBytes": 81478076,
"domNodes": 0,
"jsHeapTotalBytes": 36864,
"scriptDurationMs": 32.260999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 445.2730000000429,
"styleRecalcs": 49,
"styleRecalcDurationMs": 4.204,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 264.108,
"heapDeltaBytes": -12708008,
"heapUsedBytes": 58226056,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 89.82200000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.662962962962965,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 450.2029999999877,
"styleRecalcs": 48,
"styleRecalcDurationMs": 4.787,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 278.019,
"heapDeltaBytes": -12311568,
"heapUsedBytes": 58327168,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 95.03699999999998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2005.7869999999411,
"styleRecalcs": 12,
"styleRecalcDurationMs": 2.2250000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 285.836,
"heapDeltaBytes": 1009652,
"heapUsedBytes": 71612080,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.017,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760334,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2011.496999999963,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.576,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 294.208,
"heapDeltaBytes": 963044,
"heapUsedBytes": 70657008,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.463999999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1706.0770000000502,
"styleRecalcs": 78,
"styleRecalcDurationMs": 14.095,
"layouts": 16,
"layoutDurationMs": 4.558,
"taskDurationMs": 529.471,
"heapDeltaBytes": 14925032,
"heapUsedBytes": 69256860,
"domNodes": -248,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 69.084,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664705882352937,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1680.5009999999356,
"styleRecalcs": 76,
"styleRecalcDurationMs": 14.230000000000002,
"layouts": 16,
"layoutDurationMs": 4.55,
"taskDurationMs": 526.3240000000001,
"heapDeltaBytes": -6316536,
"heapUsedBytes": 64245536,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 75.50500000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666336633663366,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 833.1499999999323,
"styleRecalcs": 19,
"styleRecalcDurationMs": 20.35,
"layouts": 5,
"layoutDurationMs": 8.966000000000001,
"taskDurationMs": 608.6320000000001,
"heapDeltaBytes": -570388,
"heapUsedBytes": 90774448,
"domNodes": 14227,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 19.989,
"eventListeners": 2463,
"totalBlockingTimeMs": 89,
"frameDurationMs": 19.842857142857135,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8127.925000000005,
"styleRecalcs": 251,
"styleRecalcDurationMs": 36.253,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3895.3799999999997,
"heapDeltaBytes": 7537932,
"heapUsedBytes": 96572460,
"domNodes": 0,
"jsHeapTotalBytes": 1310720,
"scriptDurationMs": 1887.499,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666188524590165,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8125.5820000000085,
"styleRecalcs": 251,
"styleRecalcDurationMs": 37.51599999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3960.43,
"heapDeltaBytes": -8662756,
"heapUsedBytes": 80443832,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 1924.474,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665913757700206,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11589.747999999985,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10662.393999999998,
"heapDeltaBytes": -21232720,
"heapUsedBytes": 185242704,
"domNodes": -3045,
"jsHeapTotalBytes": 22020096,
"scriptDurationMs": 163.293,
"eventListeners": -14907,
"totalBlockingTimeMs": 0,
"frameDurationMs": 19.500000000000004,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "vue-large-graph-idle",
"durationMs": 11722.793000000023,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11198.704,
"heapDeltaBytes": -41914392,
"heapUsedBytes": 179727572,
"domNodes": -3045,
"jsHeapTotalBytes": 2727936,
"scriptDurationMs": 162.58399999999997,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 19.691092436974788,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "vue-large-graph-pan",
"durationMs": 14176.172999999948,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.261000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13577.14,
"heapDeltaBytes": -40387584,
"heapUsedBytes": 174481348,
"domNodes": -3045,
"jsHeapTotalBytes": 6459392,
"scriptDurationMs": 663.6999999999999,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 25.220959147424512,
"p95FrameDurationMs": 50
},
{
"name": "vue-large-graph-pan",
"durationMs": 14122.739000000023,
"styleRecalcs": 67,
"styleRecalcDurationMs": 14.200000000000019,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13528.197000000002,
"heapDeltaBytes": -23227584,
"heapUsedBytes": 190272564,
"domNodes": -3047,
"jsHeapTotalBytes": 6766592,
"scriptDurationMs": 696.674,
"eventListeners": -14915,
"totalBlockingTimeMs": 27,
"frameDurationMs": 24.70769230769231,
"p95FrameDurationMs": 50
},
{
"name": "vue-node-resize-workload",
"durationMs": 4574.857999999949,
"styleRecalcs": 20,
"styleRecalcDurationMs": 55.40999999999999,
"layouts": 20,
"layoutDurationMs": 23.368,
"taskDurationMs": 4416.312,
"heapDeltaBytes": -9508188,
"heapUsedBytes": 214031608,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 73.774,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 24.95355191256831,
"p95FrameDurationMs": 50
},
{
"name": "vue-node-resize-workload",
"durationMs": 4239.3730000000005,
"styleRecalcs": 20,
"styleRecalcDurationMs": 54.423,
"layouts": 20,
"layoutDurationMs": 23.541000000000007,
"taskDurationMs": 4028.6909999999993,
"heapDeltaBytes": 710440,
"heapUsedBytes": 214093556,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 62.92600000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 25.297023809523814,
"p95FrameDurationMs": 50
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5890.443000000005,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5599.434,
"heapDeltaBytes": -33479012,
"heapUsedBytes": 180805936,
"domNodes": -3045,
"jsHeapTotalBytes": 7098368,
"scriptDurationMs": 90.717,
"eventListeners": -14914,
"totalBlockingTimeMs": 0,
"frameDurationMs": 19.987837837837844,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5948.09500000008,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5514.148,
"heapDeltaBytes": -22768920,
"heapUsedBytes": 185022048,
"domNodes": -3045,
"jsHeapTotalBytes": 19398656,
"scriptDurationMs": 85.41499999999996,
"eventListeners": -14907,
"totalBlockingTimeMs": 0,
"frameDurationMs": 20.032996632996632,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "workflow-execution",
"durationMs": 463.18799999994553,
"styleRecalcs": 20,
"styleRecalcDurationMs": 14.333,
"layouts": 4,
"layoutDurationMs": 1.7329999999999999,
"taskDurationMs": 106.54899999999999,
"heapDeltaBytes": 5894628,
"heapUsedBytes": 72158212,
"domNodes": 129,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 11.365,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66428571428571,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 457.4609999999666,
"styleRecalcs": 23,
"styleRecalcDurationMs": 15.728,
"layouts": 4,
"layoutDurationMs": 1.782,
"taskDurationMs": 101.951,
"heapDeltaBytes": 5754468,
"heapUsedBytes": 71349672,
"domNodes": 126,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.936,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667857142857137,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 399.68400000009296,
"styleRecalcs": 78,
"styleRecalcDurationMs": 61.007,
"layouts": 76,
"layoutDurationMs": 14.712,
"taskDurationMs": 356.36899999999997,
"heapDeltaBytes": 12962920,
"heapUsedBytes": 85183216,
"domNodes": 76,
"jsHeapTotalBytes": 8912896,
"scriptDurationMs": 118.48400000000001,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.67083333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 393.7349999999924,
"styleRecalcs": 78,
"styleRecalcDurationMs": 63.648999999999994,
"layouts": 76,
"layoutDurationMs": 15.035,
"taskDurationMs": 358.99199999999996,
"heapDeltaBytes": 12741452,
"heapUsedBytes": 85141348,
"domNodes": 76,
"jsHeapTotalBytes": 8912896,
"scriptDurationMs": 117.669,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 747.0840000000862,
"styleRecalcs": 78,
"styleRecalcDurationMs": 177.91899999999998,
"layouts": 76,
"layoutDurationMs": 18.071,
"taskDurationMs": 723.278,
"heapDeltaBytes": 3765720,
"heapUsedBytes": 110239380,
"domNodes": 76,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 192.29600000000002,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 641.1150000000134,
"styleRecalcs": 78,
"styleRecalcDurationMs": 159.17000000000002,
"layouts": 76,
"layoutDurationMs": 15.196,
"taskDurationMs": 607.579,
"heapDeltaBytes": -22450844,
"heapUsedBytes": 106422992,
"domNodes": 76,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 147.93300000000002,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
🎭 Playwright: ✅ 2196 passed, 0 failed📊 Browser Reports
🧩 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 |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 8 finding(s).
| Severity | Count |
|---|---|
| 🔴 Critical | 1 |
| 🟠 High | 1 |
| 🟡 Medium | 4 |
| 🟢 Low | 2 |
Panel: 8/8 reviewers contributed findings.
| return { keep: true } | ||
| } | ||
| if (nameIsWritable(widget)) { | ||
| return { keep: true, cause: 'unresolved-duplicate' } |
There was a problem hiding this comment.
🔴 Critical — Returning keep: true leaves two widgets on the node under one name, so both derive the same WidgetId; ensureUniqueWidgetNames never reads the rename back, so both reach registerWidget, the second widget's name setter routes through renameWidget on a stale _state.nodeId and is handed the first widget's entry, and the pair collapses onto one WidgetState. The saved workflow then records the first widget's value in both widgets_values slots, destroying the second value on the same undo-a-deletion/paste path this change targets — unreachable on the parent commit, where the duplicate was removed before setNodeId ran — and when the two widgets have different types the re-registration instead orphans the first widget's state so its edits silently stop emitting set_widget at all. Resolve the stale binding, or keep the duplicate out of registration, rather than admitting a colliding id. Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, kimi-k3-max adversarial).
| : !Object.isExtensible(widget) | ||
| }) | ||
| ) { | ||
| if (renames.some(({ widget }) => !nameIsWritable(widget))) { |
There was a problem hiding this comment.
🟠 High — ensureUniqueWidgetNames now shares nameIsWritable, but it still assigns widget.name without reading it back and returns true unconditionally — safe only while dropUnrenamableDuplicateWidgets guaranteed the array it was handed had unique names. Now that the walk deliberately leaves an ambiguous pair in place, this reports success for a node carrying two widgets under one name, so the setNodeId/widgetId guards in BaseWidget stop bailing and mint colliding ids, and the nodeShellLifecycle.ts comment that "setNodeId would in fact register neither" is no longer true. It needs the same read-back tryRename performs, returning false when the write did not land. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
| */ | ||
| function nameIsWritable(widget: { name: string }): boolean { | ||
| const descriptor = Object.getOwnPropertyDescriptor(widget, 'name') | ||
| if (!descriptor) return Object.isExtensible(widget) |
There was a problem hiding this comment.
🟡 Medium — nameIsWritable inspects only the own descriptor, so a widget whose name is a getter-only accessor (or a non-writable data property) on its prototype has no own descriptor and falls through to Object.isExtensible(widget) — which answers whether properties can be added, not whether name can be written. Such a widget is judged renamable and kept permanently as unresolved-duplicate even though every assignment throws and is swallowed by tryRename, which is exactly the unaddressable case the removal branch exists for and the one the read-back criterion it replaced did catch. Walk the prototype chain with Reflect.getPrototypeOf/getOwnPropertyDescriptor, or fall back to the read-back verdict when there is no own descriptor. Raised by 8 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, gemini-3.1-pro adversarial, gemini-3.1-pro edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case).
| releaseRefusedWidget(node, widget) | ||
| // Only a widget the walk took off the array needs releasing; an unresolved | ||
| // duplicate is still the node's widget and must keep its slot wiring. | ||
| if (removed) releaseRefusedWidget(node, widget) |
There was a problem hiding this comment.
🟡 Medium — Skipping releaseRefusedWidget is right for a kept widget, but the rest of syncWidgetOrder is not prepared for the node still being ambiguous when this returns: it calls setNodeId on every kept widget and then replaceNodeWidgetOrder(graphId, node.id, getWidgetIds(widgets)). getWidgetIds now yields the colliding id twice and nothing in replaceNodeWidgetOrder/reconcileNodeWidgetOrder dedupes it, while the widget whose id no longer has a store entry gets filtered out — so the stored order either holds a duplicate key (duplicate Vue keys in WidgetGrid.vue's v-for, and removeNodeWidgetOrder's single indexOf splice leaves a stale id behind) or fewer ids than the node has widgets, which renders as the same visible widget loss this change set out to prevent. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
|
|
||
| // One entry here is a widget the user lost. Two is the invariant being | ||
| // enforced without charging them for it. | ||
| expect(savedNode?.widgets_values).toHaveLength(2) |
There was a problem hiding this comment.
🟡 Medium — The only assertion on the saved workflow is the arity of widgets_values, and the file header explicitly declines to assert the values because both slots hold the first widget's value. The test therefore goes green over a saved workflow that this change corrupts — the second widget's value is gone and widgets_values_named collapses to one key — so the e2e guard masks the defect closest to it; calling that "a separate pre-existing defect" understates it, since the parent commit removes the duplicate before setNodeId and never reaches the merge. Asserting both saved values (expected to fail until the merge is fixed) would keep the remaining data loss visible. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| // Only a widget the walk took off the array needs releasing; an unresolved | ||
| // duplicate is still the node's widget and must keep its slot wiring. | ||
| if (removed) releaseRefusedWidget(node, widget) | ||
| reportError( |
There was a problem hiding this comment.
🟡 Medium — A kept pair is re-found by every subsequent walk, so this reportError now fires on each syncWidgetOrder commit (push, splice, reorder, addWidget) and each attachNodeToStores, and reportError has no dedupe or throttle — every call builds an Error with a stack and dispatches to Sentry and Datadog. Previously the widget was spliced out on the first commit so the state self-cleared after one report; a pair that never resolves now emits an unbounded stream of identical warnings for the session, and a single pass that both removes and keeps double-reports because the trailing splice re-enters refuseAmbiguousWidgets. Report an unresolved pair at most once per node/widget id. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, kimi-k3-max edge-case).
| // so neither is unaddressable and neither may be removed. | ||
| expect(node.widgets).toContain(seed) | ||
| expect(node.widgets).toContain(steps) | ||
| expect(node.widgets).toHaveLength(2) |
There was a problem hiding this comment.
🟢 Low — This case stops at node.widgets arity and never re-runs the getNodeWidgets query it set up at lines 43-47, so the comment "because nothing was lost" is not what the code does: after graph.add(node) the store holds a single entry for the two widgets and both seed.value and steps.value read 1. Re-asserting getNodeWidgets(...) and both widget values would make this prove the invariant is enforced without cost, rather than only that the array still has two elements. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
| * copies of one rule. | ||
| */ | ||
| function nameIsWritable(widget: { name: string }): boolean { | ||
| const descriptor = Object.getOwnPropertyDescriptor(widget, 'name') |
There was a problem hiding this comment.
🟢 Low — Object.getOwnPropertyDescriptor and Object.isExtensible both invoke proxy traps, and this call site is reached from resolveCollision outside any guard — unlike the name reads in the same walk, which go through safeRead precisely because widget objects are treated as hostile. A proxy-backed widget whose trap throws aborts dropUnrenamableDuplicateWidgets mid-walk during LGraph.add, after node state has been partially attached, instead of being reported and refused. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).
`op435-fe19717-unique-name-invariant` moved to `8320b45884` after #20104 was opened, which left #20104 CONFLICTING and unreviewable. The two sides are orthogonal everywhere except the finding record, and both halves are kept: - `RefusedWidget` now carries `removed` (whether the walk took the widget off the array) **and** `name` (the key the walk read). They answer different questions and the report needs both. - The report loop keeps three causes and the `removed` gate on `releaseRefusedWidget` — an unresolved pair is still the node's widget and must keep its slot wiring — while taking the base's rule that the name comes from the walk, never from a re-read. The walk may have written to a hostile accessor up to `RENAME_ATTEMPTS` times, so a re-read can quote a candidate no widget holds. - Both new `errorType` constants survive: `widget_duplicate_name_unresolved` for a pair the node keeps, `widget_refusal_teardown_failed` for a refused widget whose own teardown threw. One base assertion is updated rather than deleted, openly. "reports the name the walk read" built its fixture from a normalising setter and expected `widget_duplicate_name_refused`. A normalising setter has a setter, so under this branch's criterion the write was structurally possible and the widget is kept and reported as unresolved. Its subject — the report must not quote what the rename attempts left behind — is unchanged and still asserted, and the case now also pins that the widget stays on the node. Also corrects a stale count the base introduced: the ADR said "three boundaries" over four bullets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`lint-pr / lint` runs `oxlint . --type-aware`, and the type-aware rules are the ones a plain `oxlint <paths>` never reaches — so both of these were green locally and red on CI from the moment the branch was pushed. They are the sole root cause of all five red checks on this branch: `preflight` fails on lint, and `test`, `e2e-status` and `lint-and-format` each gate on `preflight` (`PREFLIGHT: failure, UNIT: skipped`), so nothing else actually ran. - `no-unnecessary-condition`: `call[1]` is a required parameter of `reportError`, so the optional chain on it can never short-circuit. - `no-unnecessary-type-parameters`: `resolveCollision`'s `T` appears once, on `widget`, and the return type does not mention it — it never related two positions, so the structural type says the same thing. Behaviour is unchanged: the three focused suites stay at 57 passing, and `oxlint --type-aware` over the five touched files now exits 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## op435-fe19717-unique-name-invariant #20104 +/- ##
======================================================================
Coverage ? 85.80%
======================================================================
Files ? 2434
Lines ? 139414
Branches ? 35984
======================================================================
Hits ? 119622
Misses ? 19416
Partials ? 376
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: chromium Recorded test titles:
|
|
Applied the retained correctness hunk in Regression: |
Keeping an unresolved duplicate on the node let it reach `setNodeId`, and registration then welded the pair onto one `WidgetState`: a `WidgetId` is `graphId:nodeId:name`, so the duplicate's "previous" id named whichever widget had actually registered that name, and `BaseWidget.set name` moved that entry. The rename read back as success, `_state` was reassigned to the other widget's object, and the two widgets shared one value — the second widget's value destroyed on exactly the undo-a-deletion/paste path this change set targets. Unreachable before the keep branch, because the duplicate was removed before `setNodeId` ran. Measured through the harness: the saved workflow held ["first default", "first default"] for a two-widget node, so the existing arity-only assertion went green over the corruption. - `BaseWidget.set name` moves an entry only when it is the one this widget is bound to. A stale `_state.nodeId` could otherwise reach across nodes and delete an unrelated node's registration, handing its value away. - `ensureUniqueWidgetNames` reads the write back instead of returning `true` unconditionally, so the gate `setNodeId`/`widgetId` bail on stops reporting success for a node that still carries an ambiguous pair. This is what makes `attachNodeToStores`'s "setNodeId would in fact register neither" true. - `nameIsWritable` walks the prototype chain. `name` is a class accessor, so no concrete widget has an own descriptor and every one fell through to `Object.isExtensible`, which answers whether properties can be added. It is also guarded: it invokes proxy traps outside the walk's `safeRead`, and a throw aborted the walk mid-`LGraph.add`. - An unresolved pair is reported once per node rather than on every commit; `reportError` has no throttle and the pair survives every later walk. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Repaired the critical finding at the previous head, with a browser-observable red/greenThe automated review's Critical finding was raised at What was actually brokenA
Both widgets end up on one The existing e2e assertion could not see any of it, exactly as the review said. Arity was right and Fixes
The ownership guard also closes a case the review did not reach: a stale Verification
Of the 122 widget specs run locally, 7 fail identically on the unfixed head and all Playwright The remaining outdated thread about |
6bd38ed
into
op435-fe19717-unique-name-invariant
One of the eight review findings was still live when this merged, and it is the one about renderingI re-measured all eight findings from the automated review against the merged code rather than against the commit they were raised on. Seven are genuinely fixed. The eighth is not, and the fix is in #20135, stacked on this same branch. A node that keeps an ambiguous pair draws no widgets at all, including widgets that collide with nothing.
So keeping the widget stopped costing the user a widget and started costing them the node's whole widget body. That is the review's The e2e case added here goes green over it, because it only asserts the saved workflow and serialization reads The other seven, verified in the merged source:
#20135 keeps the identity rule intact: first occurrence wins, so one name still resolves to one |
…3036) (Comfy-Org#20087) ## Summary Two widgets on one node cannot share a name — `WidgetId` is `graphId:nodeId:name`, so the second is the same identity, not a second one. Where a repeat cannot be renamed apart, it is refused and reported instead of being kept under a name another widget already holds. Linear: [FE-3036](https://linear.app/comfyorg/issue/FE-3036). This is the alternative asked for on [Comfy-Org#19717](Comfy-Org#19717). ## Changes - **What**: `dropUnrenamableDuplicateWidgets` (`src/types/widgetId.ts`) renames the duplicates it can and returns the ones it cannot, each with its cause. A rename takes the first `name#n` that neither the node nor the widget store holds, so a stale store entry cannot make a renamable widget look unrenamable. There are **two** enforcement points: `syncWidgetOrder` covers every array mutation (`addWidget`, a raw `push`, a splice, a whole-array assignment) but enforces nothing until the node has a graph id, and `attachNodeToStores` → `refuseAmbiguousNodeWidgets` covers the join itself, because `LGraph.add` normalizes the widgets view before `node.graph` is set. First occurrence wins. - **The criterion is whether the name could be *written*, not whether the write *landed*.** `BaseWidget.set name` delegates to `widgetValueStore.renameWidget()` and leaves the name unchanged whenever the store declines — which it does for a missing graph, a missing entity or a missing order entry, none of which depend on the candidate name. So `nameIsWritable` decides removal and the read-back decides only whether the pair is reported: a duplicate whose rename was merely declined is **kept** and reported as unresolved. (This is [Comfy-Org#20104](Comfy-Org#20104), folded in here so that no head of this PR ships a widget-deleting rule. Comfy-Org#20104 is now wholly contained in this branch.) - Four `errorType`s, in `src/AGENTS.md`'s `<category>_<operation>_<subject>` form, because the causes are different failures: `failure_renaming_widget_duplicate_name` (removed), `failure_reading_widget_name` (no derivable id: a throwing accessor, a value that will not coerce, or one `encodeURIComponent` rejects), `failure_resolving_widget_duplicate_name` (kept, reported once per widget rather than on every commit) and `failure_tearing_down_refused_widget`. - An **empty** name is declined by the store, not refused: it renders, fires its callback and serializes, so removing it would lose a working widget (Comfy-Org#13773). - A rename while the node is detached lands locally when the store holds no entry for the widget. `_state.nodeId` outlives `graph.remove`, which deletes the node's entries, so declining there left a re-added node carrying one name twice, and that bails registration for *every* widget on the node: the node drew nothing. Measured before and after in `widgetsView.refusalCriterion.test.ts`, and `uniqueWidgetName.spec.ts` counts rendered rows after the re-add. - A refused widget's own store entry is released, by identity. It otherwise sat under the name it had registered, and `registerWidget` keeps an existing value for a same-type re-registration — so the next widget of that name came up holding a dead widget's value. - ADR-ECS-0008 carries the invariant, the refusal, the four causes, the two enforcement points and the boundaries, including what is accepted rather than fixed. - **Breaking, with migration guidance for extension authors**: a widget whose name cannot be made unique on its node is no longer added. Give widgets distinct names *before* the node joins a graph; if you redefine a widget's `name` after `addWidget` (`Object.defineProperty`, a frozen object, a getter with no setter), make sure it does not land on a name a sibling holds. To tell whether your widget survived, read it back off the node — `node.widgets.includes(widget)` — rather than assuming `addWidget`/`addCustomWidget` kept it; a refusal also emits one of the `errorType`s above. A duplicate whose `name` is writable is renamed, so ordinary dynamic widgets are unaffected. ## Review Focus **Refusing is a repair, not only a restriction.** Before this change, a node carrying an ambiguous pair rendered **no widgets at all**: `BaseWidget.setNodeId` calls `ensureUniqueWidgetNames(this.node.widgets)` and returns early when it fails, for *every* widget on the node. Measured on the parent through the real app when this PR was opened: `node.widgets` held `["duplicate", "duplicate"]` while the canvas rendered 0 widget rows, and nothing the user typed on that node survived a reload. **One accepted consequence, recorded rather than left implicit.** `LGraph.configure` adds each node before configuring it, so a removal has already happened when values are restored, and positional restore counts the widgets the node has now: for `[a, dup, b]` saved as `[1, 2, 3]`, `b` is handed `2` and `3` is dropped. It takes all three of a pre-change workflow, a widget whose `name` cannot be written, and no saved name register — a renamable duplicate is kept, and `widgets_values_named` restores each widget under its own name. All three are measured in `widgetsView.refusalValueRestore.test.ts`, and the ADR records why the index-map alternative is not taken here. **Two findings deliberately left for the consolidation they belong to**, both raised in review and neither a wrong value: teardown a caller attaches *after* `addWidget` returns never runs for a refused widget, and `litegraphService.addInputWidget` resolves the widget it just created by identity or by name and so cannot tell a refused widget from one an extension removed. Both want an explicit accepted/refused result out of `addCustomWidget` — the same change that would collapse `dropUnrenamableDuplicateWidgets` and `ensureUniqueWidgetNames` into one walk. That is a larger piece of work than this PR and is tracked in [FE-3222](https://linear.app/comfyorg/issue/FE-3222). ## Tests - `browser_tests/tests/widgets/uniqueWidgetName.spec.ts`: two cases sharing one node-type patch, one save-and-read helper and a test-scoped workflow name the fixture deletes. - The refused duplicate: one row rendered under the name, the typed value in the saved document, and the same value after close and reopen. Red on the parent (`toHaveCount(1)` receives 0). - A duplicate formed while the node was detached: after the re-add the node draws `alpha` and `alpha#1`, and saves both values. - Unit cases: `src/types/widgetId.test.ts` (35, including the pre-existing id tests), `widgetsView.uniqueWidgetName.test.ts` (23), `widgetsView.refusalCriterion.test.ts` (6), `widgetsView.emptyWidgetName.test.ts` (3), `widgetsView.refusalValueRestore.test.ts` (3), plus two in `src/scripts/domWidget.test.ts` for the registration guards. Mutations, each reverted before the next, every suite green unmutated: | Mutation | Result | | --- | --- | | drop the `addWidget` refusal guard (attached node) | 1 failed | | drop the `onAdded` refusal guard (node joins a graph) | 1 failed | | let a duplicate's rename move an entry it is not bound to | 1 failed | | leave the refused widget's own entry behind | 1 failed | | decline a detached rename again when the store holds no entry | 2 failed | | ignore names the store holds when choosing a suffix | 1 failed | | dedupe the unresolved report per name instead of per widget | 1 failed | | release a kept duplicate as if it were refused | 2 failed | | drop the guard against a hole in `node.widgets` | 1 failed | Commands: - `pnpm typecheck`, `pnpm typecheck:browser`, `pnpm knip` exit 0. `oxfmt --check` clean on the changed files. `oxlint --type-aware` reports no errors. Its only `comfy(no-restricted-paths)` warning is the pre-existing `widgetsView.ts` dependency on `widgetValueStore`; refusal telemetry is now reported from `attachNodeToStores` in the app layer. - `pnpm exec vitest run src/types src/lib/litegraph src/core/graph src/scripts src/stores src/services src/utils/litegraphUtil`: 288 files, 4696 passed, 10 expected fail, 0 failed. ## Screenshots (if applicable) Before/after stills are in [this comment](Comfy-Org#20087 (comment)): the parent draws 0 widget rows for the detached-collision node, this head draws `alpha` and `alpha#1`, and the refused-duplicate node keeps its one usable row. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: GitHub Action <action@github.com>
Summary
The unique-name invariant decided "this widget cannot be named uniquely" from whether a rename read back, and on that signal it removed ordinary, fully renamable widgets — so enforcing the invariant cost the user a widget and a serialized slot.
Stacked on #20087; the base is that branch, so the diff here is only this correction. #20087's uniqueness policy and the FE-3036 option-B choice are unchanged — this fixes the criterion inside it, not the policy.
Changes
nameIsWritablepredicate decides whether the widget is removed. It is extracted fromensureUniqueWidgetNamesrather than duplicated, becausesetNodeIdgates registration on that same rule — two copies disagreeing is a widget destroyed over a disagreement. A pair the node keeps is reported under a third stableerrorType,widget_duplicate_name_unresolved.RefusedWidgetgainsremoved, so the caller only tears down widgets that actually left the array. ADR-ECS-0008 amended.namegenuinely cannot be written is still removed underwidget_duplicate_name_refused, and that case's proof is unchanged.Review Focus
Why the read-back is the wrong removal signal.
BaseWidget.set name(BaseWidget.ts:145-152) delegates towidgetValueStore.renameWidget()andreturns without changing_namewhen the store declines.renameWidgetdeclines when the node has no entry for the old id (widgetValueStore.ts:400) — andsetNodeIdbails before registering anything wheneverensureUniqueWidgetNamesfails (BaseWidget.ts:399), which is exactly what an ambiguous pair causes. Node removal also clears the entries (LGraph.ts:317) while nothing resets_state.nodeId. So a failed read-back is a recoverable store refusal at least as often as a hostile object, and the two are indistinguishable from the read alone.Measured on the parent commit through the real app, a node deleted and re-added comes back one widget short and saves one
widgets_valuesentry for a two-widget node. Positional widget addressing reads that arity, so a dropped slot shifts every later widget.0eb794a9a8node.widgets["alpha"]["alpha","alpha#1"]widgets_values["first default"]["first default","first default"]The one deliberate behaviour reversal. Two cases on the base branch asserted that a setter which silently ignores a rename is removed. They now assert it is reported and kept. The concern behind them — that an ambiguous pair must not pass unnoticed — is preserved by the new
errorTyperather than dropped; what changed is that it is no longer paid for with the widget.Known defect this does not fix, and deliberately does not assert as correct. Re-registering an ambiguous pair routes the second widget's
namesetter throughrenameWidgeton a stale_state.nodeId, which hands it the first widget's store entry — so both widgets then read the first widget's value. That is a separate pre-existing defect inBaseWidget.set name, present on the base branch too. The browser spec asserts the arity of the saved array for that reason and says so in its header.Evidence
Node 26 per
.nvmrc,NODE_OPTIONS=--no-experimental-webstorageon every vitest run, dev server on a leased 6200-band port against a private local backend on 8190.browser_tests/tests/widgets/renamableDuplicateWidgetKept.spec.ts— red on parent (widgets_valueslength 1, expected 2), green here.src/types/widgetId.test.ts,src/lib/litegraph/src/node/widgetsView.refusalCriterion.test.ts,…/widgetsView.uniqueWidgetName.test.ts— 51 cases. The new litegraph case is red on parent.removedflag hardcoded, the reporting condition inverted, the kept-widget teardown guard removed, and the unresolved cause collapsed into the refusederrorType. Two earlier mutants survived a first pass and both were real: an unjustified splice-guard change (reverted — no test could justify it) and a missing case for tearing down a widget the node kept (now pinned).vitest run src/lib/litegraph src/stores src/types src/core/graph— 218 files, 3700 passed, 10 expected fail, 0 failed.typecheck:app,typecheck:browser,oxfmt --check,fallow audit --changed-since(both against the base commit andorigin/main) — exit 0.oxlintreports only the 5no-restricted-pathswarnings the base branch already emits on these files.🤖 Generated with Claude Code