Skip to content

feat: assert registration-identity invariants in registerNodeState/nodeDataStore - #15726

Closed
christian-byrne wants to merge 3 commits into
feature/ecs-migrationfrom
be-5048-assert-registration-invariants
Closed

christian-byrne wants to merge 3 commits into
feature/ecs-migrationfrom
be-5048-assert-registration-invariants

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

Summary

Closes BE-5048 / #15706

Three silent failure modes in the node-data-store registration lifecycle now assert in DEV instead of failing silently:

  • Cross-root re-registration (registerNodeState): asserts node._graphScope.rootGraphId matches the new graph's root before mutating state — previously would strand the old bucket entry as a ghost
  • Identity drift on unregister (unregisterNodeState): captures the boolean return from deleteNode and asserts it's true — catches cases where _state was reassigned after registration, leaving a ghost NodeState the renderer keeps drawing
  • Duplicate NodeState for same (id, graphId) (nodeDataStore.registerNode): replaces the silent return undefined with an assert(false, ...) for the case where a genuinely different state object collides on the same id — idempotent same-object re-registration still returns early without asserting

Test plan

  • pnpm test:unit fully green (22 tests pass across nodeDataStore.test.ts and LGraphNode.nodeState.test.ts)
  • New tests cover: cross-root assert, identity-drift assert, duplicate-identity assert, idempotent same-state re-registration does NOT assert, normal register→remove does NOT assert

🤖 Generated with Claude Code

…deDataStore

Catches three silent failure modes in the node-data-store lifecycle:
- Cross-root re-registration: asserts node._graphScope.rootGraphId matches before registering
- Identity drift on unregister: asserts deleteNode returns true (state found in bucket)
- Duplicate NodeState for same (id, graphId): asserts in registerNode instead of silent undefined

Also adds unit tests for all three failure modes plus the idempotent same-state re-registration happy path.

Closes BE-5048

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 23, 2026
@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 76e065ea-5e69-4688-8072-4c82ffed4345

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1991 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1970 / ❌ 0 / ⚠️ 1 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/23/2026, 09:59:56 AM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.3 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.2 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.6 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 68.6 MB heap
large-graph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.6 MB heap
large-graph-pan: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 29ms TBT · 68.5 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 1ms TBT · 70.2 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 2ms TBT · 72.3 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.6 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.9 MB heap
subgraph-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 53.9 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.7 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 155ms TBT · 95.0 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 17ms TBT · 81.8 MB heap
vue-large-graph-idle: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 168.7 MB heap
vue-large-graph-pan: · 52.9 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 159ms TBT · 161.1 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.1 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 8ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 533ms
canvas-idle: script duration 11ms
canvas-idle: TBT 0ms
canvas-idle: heap used 65.3 MB
canvas-idle: DOM nodes -282
canvas-idle: event listeners -155
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 48ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 80
canvas-mouse-sweep: task duration 1430ms
canvas-mouse-sweep: script duration 186ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 67.2 MB
canvas-mouse-sweep: DOM nodes -280
canvas-mouse-sweep: event listeners -171
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 19ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 32
canvas-zoom-sweep: task duration 388ms
canvas-zoom-sweep: script duration 13ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 69.6 MB
canvas-zoom-sweep: DOM nodes 75
canvas-zoom-sweep: event listeners 20
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 6ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 9
dom-widget-clipping: task duration 464ms
dom-widget-clipping: script duration 35ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 68.6 MB
dom-widget-clipping: DOM nodes 14
dom-widget-clipping: event listeners 2
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 4ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 4
large-graph-idle: task duration 634ms
large-graph-idle: script duration 45ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 65.6 MB
large-graph-idle: DOM nodes -281
large-graph-idle: event listeners -169
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 13ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 66
large-graph-pan: task duration 2934ms
large-graph-pan: script duration 1053ms
large-graph-pan: TBT 29ms
large-graph-pan: heap used 68.5 MB
large-graph-pan: DOM nodes -281
large-graph-pan: event listeners -179
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 8ms
large-graph-zoom: style recalc duration 13ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 66
large-graph-zoom: task duration 2786ms
large-graph-zoom: script duration 947ms
large-graph-zoom: TBT 1ms
large-graph-zoom: heap used 70.2 MB
large-graph-zoom: DOM nodes -121
large-graph-zoom: event listeners -83
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 5ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 41
legacy-node-drag: task duration 2386ms
legacy-node-drag: script duration 265ms
legacy-node-drag: TBT 2ms
legacy-node-drag: heap used 72.3 MB
legacy-node-drag: DOM nodes -143
legacy-node-drag: event listeners 94
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 3ms
minimap-idle: layout count 0
minimap-idle: style recalc count 3
minimap-idle: task duration 628ms
minimap-idle: script duration 45ms
minimap-idle: TBT 0ms
minimap-idle: heap used 66.6 MB
minimap-idle: DOM nodes -283
minimap-idle: event listeners -169
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 9ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 44
subgraph-dom-widget-clipping: task duration 538ms
subgraph-dom-widget-clipping: script duration 142ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 83.9 MB
subgraph-dom-widget-clipping: DOM nodes 13
subgraph-dom-widget-clipping: event listeners 8
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 8ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 8
subgraph-idle: task duration 520ms
subgraph-idle: script duration 9ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 53.9 MB
subgraph-idle: DOM nodes -297
subgraph-idle: event listeners -201
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 45ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 79
subgraph-mouse-sweep: task duration 1216ms
subgraph-mouse-sweep: script duration 128ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 66.7 MB
subgraph-mouse-sweep: DOM nodes -298
subgraph-mouse-sweep: event listeners -216
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 15ms
subgraph-transition-enter: style recalc duration 33ms
subgraph-transition-enter: layout count 14
subgraph-transition-enter: style recalc count 19
subgraph-transition-enter: task duration 1026ms
subgraph-transition-enter: script duration 35ms
subgraph-transition-enter: TBT 155ms
subgraph-transition-enter: heap used 95.0 MB
subgraph-transition-enter: DOM nodes 13671
subgraph-transition-enter: event listeners 2383
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 39ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 245
viewport-pan-sweep: task duration 10340ms
viewport-pan-sweep: script duration 3575ms
viewport-pan-sweep: TBT 17ms
viewport-pan-sweep: heap used 81.8 MB
viewport-pan-sweep: DOM nodes -279
viewport-pan-sweep: event listeners -125
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 17895ms
vue-large-graph-idle: script duration 385ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 168.7 MB
vue-large-graph-idle: DOM nodes -6548
vue-large-graph-idle: event listeners -7473
vue-large-graph-pan: avg frame time 19ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 23ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 177
vue-large-graph-pan: task duration 22603ms
vue-large-graph-pan: script duration 992ms
vue-large-graph-pan: TBT 159ms
vue-large-graph-pan: heap used 161.1 MB
vue-large-graph-pan: DOM nodes -6548
vue-large-graph-pan: event listeners -7467
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 19ms
workflow-execution: layout count 3
workflow-execution: style recalc count 13
workflow-execution: task duration 121ms
workflow-execution: script duration 8ms
workflow-execution: TBT 0ms
workflow-execution: heap used 66.1 MB
workflow-execution: DOM nodes 135
workflow-execution: event listeners 62
Raw data
{
  "timestamp": "2026-08-23T10:20:16.347Z",
  "gitSha": "dbb7ec11d4a815f73f78d8b24cbb41b885e0b77e",
  "branch": "be-5048-assert-registration-invariants",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2034.8410000000285,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.472000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 521.691,
      "heapDeltaBytes": -11286692,
      "heapUsedBytes": 58636864,
      "domNodes": -283,
      "jsHeapTotalBytes": 5496832,
      "scriptDurationMs": 10.415,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2055.513000000019,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 9.178,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 544.564,
      "heapDeltaBytes": 8456852,
      "heapUsedBytes": 78370596,
      "domNodes": -281,
      "jsHeapTotalBytes": 5496832,
      "scriptDurationMs": 10.827,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2488.9629999999556,
      "styleRecalcs": 82,
      "styleRecalcDurationMs": 48.239000000000004,
      "layouts": 12,
      "layoutDurationMs": 4.401999999999999,
      "taskDurationMs": 1497.5990000000002,
      "heapDeltaBytes": -5417396,
      "heapUsedBytes": 63547092,
      "domNodes": -279,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 193.62800000000001,
      "eventListeners": -187,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2241.184999999973,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 48.373000000000005,
      "layouts": 12,
      "layoutDurationMs": 3.9459999999999997,
      "taskDurationMs": 1362.5280000000002,
      "heapDeltaBytes": 8304304,
      "heapUsedBytes": 77305780,
      "domNodes": -280,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 179.043,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1751.9439999999804,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 18.721999999999998,
      "layouts": 6,
      "layoutDurationMs": 0.755,
      "taskDurationMs": 392.57200000000006,
      "heapDeltaBytes": 3745004,
      "heapUsedBytes": 73050228,
      "domNodes": 74,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 13.418,
      "eventListeners": 21,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1736.6169999999101,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 20.027000000000005,
      "layouts": 6,
      "layoutDurationMs": 0.819,
      "taskDurationMs": 383.70000000000005,
      "heapDeltaBytes": 3959532,
      "heapUsedBytes": 72997504,
      "domNodes": 76,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 12.956,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 735.8319999999594,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.182,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 455.68899999999996,
      "heapDeltaBytes": -6809776,
      "heapUsedBytes": 62243356,
      "domNodes": 14,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 34.044000000000004,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 751.7329999999447,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 6.638999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 471.6389999999999,
      "heapDeltaBytes": 19735784,
      "heapUsedBytes": 81683992,
      "domNodes": 14,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 36.11599999999999,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2051.5819999999962,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 4.218,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 627.7530000000002,
      "heapDeltaBytes": -21732996,
      "heapUsedBytes": 68750696,
      "domNodes": -281,
      "jsHeapTotalBytes": 4714496,
      "scriptDurationMs": 45.263,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2054.6540000000277,
      "styleRecalcs": 4,
      "styleRecalcDurationMs": 4.143000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 640.564,
      "heapDeltaBytes": -21857004,
      "heapUsedBytes": 68850452,
      "domNodes": -281,
      "jsHeapTotalBytes": 4714496,
      "scriptDurationMs": 44.42,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 3808.915000000013,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 11.696000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2935.888,
      "heapDeltaBytes": -17966812,
      "heapUsedBytes": 66149404,
      "domNodes": -282,
      "jsHeapTotalBytes": 3891200,
      "scriptDurationMs": 1053.113,
      "eventListeners": -179,
      "totalBlockingTimeMs": 28,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-pan",
      "durationMs": 3822.520000000054,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 13.387999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2932.678,
      "heapDeltaBytes": -13424060,
      "heapUsedBytes": 77565904,
      "domNodes": -279,
      "jsHeapTotalBytes": 4939776,
      "scriptDurationMs": 1053.3260000000002,
      "eventListeners": -179,
      "totalBlockingTimeMs": 29,
      "frameDurationMs": 16.66333333333338,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 4662.346999999954,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 12.534999999999998,
      "layouts": 60,
      "layoutDurationMs": 8.024,
      "taskDurationMs": 2787.703,
      "heapDeltaBytes": 8154148,
      "heapUsedBytes": 74677632,
      "domNodes": 24,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 964.5879999999999,
      "eventListeners": 12,
      "totalBlockingTimeMs": 1,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 4634.41499999999,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 12.508000000000001,
      "layouts": 60,
      "layoutDurationMs": 8.097,
      "taskDurationMs": 2784.9519999999998,
      "heapDeltaBytes": 495528,
      "heapUsedBytes": 72479304,
      "domNodes": -265,
      "jsHeapTotalBytes": -1875968,
      "scriptDurationMs": 929.131,
      "eventListeners": -177,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3547.3610000000235,
      "styleRecalcs": 41,
      "styleRecalcDurationMs": 5.496999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2457.0570000000002,
      "heapDeltaBytes": -396400,
      "heapUsedBytes": 71912916,
      "domNodes": -285,
      "jsHeapTotalBytes": -827392,
      "scriptDurationMs": 277.907,
      "eventListeners": -1,
      "totalBlockingTimeMs": 4,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3436.177999999927,
      "styleRecalcs": 41,
      "styleRecalcDurationMs": 5.127,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 2315.561,
      "heapDeltaBytes": 12998400,
      "heapUsedBytes": 79660012,
      "domNodes": 0,
      "jsHeapTotalBytes": 942080,
      "scriptDurationMs": 253.081,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "minimap-idle",
      "durationMs": 2091.3550000000214,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 3.3480000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 631.35,
      "heapDeltaBytes": -21983364,
      "heapUsedBytes": 70539900,
      "domNodes": -281,
      "jsHeapTotalBytes": 3928064,
      "scriptDurationMs": 50.952,
      "eventListeners": -153,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2043.517999999949,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 3.1680000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 624.3489999999999,
      "heapDeltaBytes": -22502480,
      "heapUsedBytes": 69207092,
      "domNodes": -284,
      "jsHeapTotalBytes": 3665920,
      "scriptDurationMs": 39.623,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 756.2800000000607,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 9.395000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 538.122,
      "heapDeltaBytes": 17512164,
      "heapUsedBytes": 87846668,
      "domNodes": 14,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 141.121,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 742.8859999999986,
      "styleRecalcs": 43,
      "styleRecalcDurationMs": 8.357999999999997,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 538.6059999999999,
      "heapDeltaBytes": 17850656,
      "heapUsedBytes": 88165540,
      "domNodes": 12,
      "jsHeapTotalBytes": 5767168,
      "scriptDurationMs": 142.60500000000002,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2031.9070000000465,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 8.280000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 527.6899999999999,
      "heapDeltaBytes": -13892612,
      "heapUsedBytes": 55840628,
      "domNodes": -297,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 9.512,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2033.4459999999126,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 8.149,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 512.674,
      "heapDeltaBytes": -12538976,
      "heapUsedBytes": 57103904,
      "domNodes": -297,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 9.189000000000002,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1974.4160000000193,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 45.88399999999999,
      "layouts": 16,
      "layoutDurationMs": 4.814,
      "taskDurationMs": 1235.121,
      "heapDeltaBytes": 12939424,
      "heapUsedBytes": 75736548,
      "domNodes": -298,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 127.775,
      "eventListeners": -231,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1930.2710000000616,
      "styleRecalcs": 80,
      "styleRecalcDurationMs": 44.028999999999996,
      "layouts": 16,
      "layoutDurationMs": 4.854000000000001,
      "taskDurationMs": 1195.906,
      "heapDeltaBytes": -5498196,
      "heapUsedBytes": 64213040,
      "domNodes": -297,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 128.62500000000003,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1434.951999999953,
      "styleRecalcs": 19,
      "styleRecalcDurationMs": 33.306000000000004,
      "layouts": 14,
      "layoutDurationMs": 14.994999999999997,
      "taskDurationMs": 1026.2479999999998,
      "heapDeltaBytes": 17935676,
      "heapUsedBytes": 99627604,
      "domNodes": 13671,
      "jsHeapTotalBytes": 10747904,
      "scriptDurationMs": 34.605,
      "eventListeners": 2383,
      "totalBlockingTimeMs": 155,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 13270.83099999993,
      "styleRecalcs": 245,
      "styleRecalcDurationMs": 38.46000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 10214.215999999999,
      "heapDeltaBytes": -11631980,
      "heapUsedBytes": 78995384,
      "domNodes": -277,
      "jsHeapTotalBytes": 3072000,
      "scriptDurationMs": 3465.829,
      "eventListeners": -125,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 13780.726000000072,
      "styleRecalcs": 245,
      "styleRecalcDurationMs": 38.66700000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 10466.335000000001,
      "heapDeltaBytes": 2186024,
      "heapUsedBytes": 92513224,
      "domNodes": -280,
      "jsHeapTotalBytes": 4382720,
      "scriptDurationMs": 3683.695,
      "eventListeners": -125,
      "totalBlockingTimeMs": 34,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 18681.970999999976,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17831.053,
      "heapDeltaBytes": -34665552,
      "heapUsedBytes": 176846516,
      "domNodes": -6548,
      "jsHeapTotalBytes": -5705728,
      "scriptDurationMs": 377.745,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.780000000000047,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 18811.147000000004,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 17958.203,
      "heapDeltaBytes": -29720772,
      "heapUsedBytes": 176982612,
      "domNodes": -6548,
      "jsHeapTotalBytes": -57344,
      "scriptDurationMs": 392.07599999999996,
      "eventListeners": -7475,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.773333333333238,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 22914.10099999996,
      "styleRecalcs": 175,
      "styleRecalcDurationMs": 23.336999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 22609.328999999998,
      "heapDeltaBytes": -51627404,
      "heapUsedBytes": 168795692,
      "domNodes": -6548,
      "jsHeapTotalBytes": 1130496,
      "scriptDurationMs": 983.919,
      "eventListeners": -7467,
      "totalBlockingTimeMs": 139,
      "frameDurationMs": 19.44333333333319,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 22919.823000000066,
      "styleRecalcs": 179,
      "styleRecalcDurationMs": 23.09699999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 22596.193,
      "heapDeltaBytes": -36429452,
      "heapUsedBytes": 169053036,
      "domNodes": -6548,
      "jsHeapTotalBytes": 249856,
      "scriptDurationMs": 1001.0210000000002,
      "eventListeners": -7467,
      "totalBlockingTimeMs": 178,
      "frameDurationMs": 18.33666666666662,
      "p95FrameDurationMs": 16.700000000004366
    },
    {
      "name": "workflow-execution",
      "durationMs": 490.02500000005966,
      "styleRecalcs": 17,
      "styleRecalcDurationMs": 20.621000000000002,
      "layouts": 3,
      "layoutDurationMs": 1.377,
      "taskDurationMs": 137.34500000000003,
      "heapDeltaBytes": 5756364,
      "heapUsedBytes": 68646368,
      "domNodes": 140,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 9.628999999999998,
      "eventListeners": 99,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "workflow-execution",
      "durationMs": 129.598999999871,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 16.830000000000002,
      "layouts": 3,
      "layoutDurationMs": 1.4460000000000002,
      "taskDurationMs": 103.81899999999999,
      "heapDeltaBytes": 3285968,
      "heapUsedBytes": 69883296,
      "domNodes": 130,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 6.095999999999999,
      "eventListeners": 25,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Aug 23, 2026
@christian-byrne

Copy link
Copy Markdown
Contributor Author

The third assert in this PR has been tried before and it went red. Flagging before this merges, because it is non-draft and three days from the branch merge.

The hunk:

-    if (incumbent) return undefined
+    if (incumbent) {
+      assert(
+        false,
+        `nodeDataStore: duplicate NodeState for node ${state.id} in graph ${state.graphId}`
+      )
+      return undefined
+    }

That is the unconditional rejection branch, and assert() throws under import.meta.env.DEV (src/base/assert.ts), so this is a test-suite failure and not a log line.

Prior measurement. BE-5048's worker reported on 2026-07-30, in that ticket's comments: the new nodeDataStore duplicate-NodeState assert "throws on real LGraph.configure/subgraph-dedup paths (LGraph.test.ts, proxyWidgetMigration.test.ts)". The work was pushed as WIP #14405, then shipped as #14443 into matt/be-5050-node-shell-state, and it escalated a question that has never been answered: "needs a human call on whether the assert found a real duplicate-registration defect or is over-strict for subgraph-definition registration."

Why the branch reaches it on ordinary input. Subgraph.state returns rootGraph.state, so subgraphs share the root's id counter, while nodeDataStore's bucket is root-flat. Ids arriving through configure() or paste are observed, not minted, and the only production caller resolves the collision by re-minting:

// LGraph.ts:1171
while (!registerNodeState(this, node)) node.id = mintNodeId(state)

So a rejection here is the retry protocol working, not necessarily an invariant violation. Asserting on it makes the normal path throw in DEV.

The other two asserts in this PR — cross-root re-registration and identity drift on unregister — do not have this problem. They fire on states the caller cannot reach legitimately, and they are worth having.

Suggested change: keep asserts 1 and 2, drop or narrow assert 3. If it stays, gate it on the case the caller cannot resolve rather than on every incumbent, and answer the July question first with the red arms that already exist (LGraph.test.ts, proxyWidgetMigration.test.ts under #14443's version) — if those collisions are legitimate subgraph-definition registration, the assert is over-strict; if any is a genuine duplicate registration, it is a load-path defect and the silent re-mint has been hiding it.

Also, three open PRs are rewriting this same branch right now, and whichever lands first conflicts with the other two:

Worth picking one before any of them merges.

Context: FE-1810 and BE-5048 comment threads; decisions.md D-gl-A2 in the ecs-migration workspace.

…ror directives

vue-tsc failed with three errors in this file, which failed `setup` and
cascaded to test, lint-and-format, scan, perf-tests, validate-fonts,
e2e-status and merge-reports:

  186:13 TS6133 'subgraph' is declared but its value is never read
  195:5  TS2578 Unused '@ts-expect-error' directive
  201:5  TS2578 Unused '@ts-expect-error' directive

`node._state` assignment type-checks without suppression, so both
directives were errors in themselves. The IIFE only existed to name the
subgraph binding that was never used.
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib/litegraph/src/LGraphNode.ts 66.66% 0 Missing and 1 partial ⚠️
@@                    Coverage Diff                    @@
##           feature/ecs-migration   #15726      +/-   ##
=========================================================
- Coverage                  82.31%   82.30%   -0.01%     
=========================================================
  Files                       1900     1900              
  Lines                     107652   107656       +4     
  Branches                   34061    34062       +1     
=========================================================
  Hits                       88610    88610              
- Misses                     18706    18718      +12     
+ Partials                     336      328       -8     
Flag Coverage Δ
e2e 67.96% <83.33%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/stores/nodeDataStore.ts 98.50% <100.00%> (+0.04%) ⬆️
src/lib/litegraph/src/LGraphNode.ts 69.77% <66.66%> (-0.03%) ⬇️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@christian-byrne

Copy link
Copy Markdown
Contributor Author

Closing in favour of #15720. assert(false) on duplicate registration changes the collision contract from a rejection the caller resolves to a throw. Collision handling is load-bearing exactly where input data is untrusted (load and paste), so a throw here turns a corrupt workflow file into a hard load failure. The LGraphNode-level invariant asserts (cross-root re-register, unregister identity drift) are a separate idea worth re-proposing on top of #15720 if wanted.

@huang47 huang47 added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:xhigh PR risk grade (advisory shadow check; grader-owned) size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants