Repository navigation
fix(assets): capture canvas state after an image upload commits - #15069
Conversation
An image dropped on a Load Image node commits its widget value with a bare property assignment and never nudges the change tracker. HTML5 drag-and-drop emits no mouseup, and the upload resolves after the gesture ends, so none of ChangeTracker's input hooks fire: captureCanvasState is never called, graphChanged is never dispatched, and the 512ms draft persist never runs. Reloading the browser restores the previous image.
Workflow drafts persist on graphChanged, which ChangeTracker only dispatches from captureCanvasState. Its hooks are all user-input events, and HTML5 drag-and-drop emits no mouseup while the upload resolves after the gesture ends, so a dropped image never reached the draft and a reload restored the previous one. Capture on commit, matching createAssetWidget, which already does this for the asset browser.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1805 passed, 0 failed · 2 flaky📊 Browser Reports
📦 Bundle: 8.71 MB gzip 🔴 +71 BDetailsSummary
Category Glance App Entry Points — 3.67 kB (baseline 3.67 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.36 MB (baseline 1.36 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 565 kB (baseline 565 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 16 unchanged User & Accounts — 27 kB (baseline 27 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 4 unchanged Editors & Dialogs — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 67.1 kB (baseline 67.1 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 8 unchanged Data & Services — 3.51 MB (baseline 3.51 MB) • 🔴 +76 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 550 kB (baseline 550 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 20 unchanged Vendor & Third-Party — 16.3 MB (baseline 16.3 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 17 unchanged Other — 14.1 MB (baseline 14.1 MB) • ⚪ 0 BBundles that do not match a named category
Status: 68 added / 68 removed / 217 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-12T04:35:59.692Z",
"gitSha": "72666890a244f27a411706b0ee44301d6245122e",
"branch": "cb/trackB-upload-persist",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2057.0690000000127,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.7429999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 491.614,
"heapDeltaBytes": 5569144,
"heapUsedBytes": 69846148,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 15.399,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2021.840999999995,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.825999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 451.025,
"heapDeltaBytes": 5917876,
"heapUsedBytes": 70547100,
"domNodes": 18,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 14.765999999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1994.3680000000086,
"styleRecalcs": 79,
"styleRecalcDurationMs": 44.947,
"layouts": 12,
"layoutDurationMs": 4.233,
"taskDurationMs": 967.797,
"heapDeltaBytes": 670136,
"heapUsedBytes": 64916680,
"domNodes": 62,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 124.85900000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1790.9939999999551,
"styleRecalcs": 72,
"styleRecalcDurationMs": 31.243,
"layouts": 12,
"layoutDurationMs": 3.3080000000000003,
"taskDurationMs": 852.537,
"heapDeltaBytes": -14219016,
"heapUsedBytes": 50226620,
"domNodes": -282,
"jsHeapTotalBytes": 23568384,
"scriptDurationMs": 110.10600000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.0299999999806,
"styleRecalcs": 32,
"styleRecalcDurationMs": 16.897000000000002,
"layouts": 6,
"layoutDurationMs": 0.673,
"taskDurationMs": 389.29400000000004,
"heapDeltaBytes": 8682440,
"heapUsedBytes": 73355904,
"domNodes": 77,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 20.592000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.9350000000304,
"styleRecalcs": 32,
"styleRecalcDurationMs": 14.815000000000001,
"layouts": 6,
"layoutDurationMs": 0.6230000000000001,
"taskDurationMs": 376.73300000000006,
"heapDeltaBytes": 8825792,
"heapUsedBytes": 73210692,
"domNodes": 77,
"jsHeapTotalBytes": 24117248,
"scriptDurationMs": 19.138,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 611.930000000001,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.560999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 392.93500000000006,
"heapDeltaBytes": -11300688,
"heapUsedBytes": 53184912,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 58.090999999999994,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 563.9760000000251,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.145,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 360.736,
"heapDeltaBytes": -11248260,
"heapUsedBytes": 53165192,
"domNodes": 16,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 54.419,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2022.5260000000276,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.254999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 666.5229999999999,
"heapDeltaBytes": 6678228,
"heapUsedBytes": 66254884,
"domNodes": -281,
"jsHeapTotalBytes": 2461696,
"scriptDurationMs": 93.49199999999999,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2049.021000000039,
"styleRecalcs": 8,
"styleRecalcDurationMs": 12.489999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 694.1419999999999,
"heapDeltaBytes": 3713912,
"heapUsedBytes": 63276768,
"domNodes": -282,
"jsHeapTotalBytes": 3510272,
"scriptDurationMs": 95.251,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2147.950000000037,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.370999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1244.853,
"heapDeltaBytes": 4200296,
"heapUsedBytes": 65369816,
"domNodes": -286,
"jsHeapTotalBytes": 3702784,
"scriptDurationMs": 399.11,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2189.1030000000455,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.497,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1260.964,
"heapDeltaBytes": 5292732,
"heapUsedBytes": 66316956,
"domNodes": -284,
"jsHeapTotalBytes": 3702784,
"scriptDurationMs": 430.23599999999993,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3210.509000000002,
"styleRecalcs": 65,
"styleRecalcDurationMs": 15.928,
"layouts": 60,
"layoutDurationMs": 8.279,
"taskDurationMs": 1550.1309999999999,
"heapDeltaBytes": -3447136,
"heapUsedBytes": 59775756,
"domNodes": -288,
"jsHeapTotalBytes": 6656000,
"scriptDurationMs": 532.9939999999999,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3126.408999999967,
"styleRecalcs": 64,
"styleRecalcDurationMs": 13.742999999999999,
"layouts": 60,
"layoutDurationMs": 7.645,
"taskDurationMs": 1406.847,
"heapDeltaBytes": 23515192,
"heapUsedBytes": 86376028,
"domNodes": 10,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 497.647,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2037.0279999999639,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.018999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 696.9000000000001,
"heapDeltaBytes": 7058044,
"heapUsedBytes": 68271960,
"domNodes": -284,
"jsHeapTotalBytes": 3510272,
"scriptDurationMs": 105.76100000000001,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2022.613999999976,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.3290000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 666.3619999999999,
"heapDeltaBytes": 5652404,
"heapUsedBytes": 66229656,
"domNodes": -282,
"jsHeapTotalBytes": 3772416,
"scriptDurationMs": 89.85399999999998,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 579.1169999999966,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.609,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 390.953,
"heapDeltaBytes": -10740924,
"heapUsedBytes": 53942556,
"domNodes": 18,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 120.974,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 590.6689999999344,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.131999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 393.22900000000004,
"heapDeltaBytes": -11090356,
"heapUsedBytes": 53472500,
"domNodes": 20,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 121.10600000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2028.345999999999,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.625000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 474.6839999999999,
"heapDeltaBytes": 5903304,
"heapUsedBytes": 70529976,
"domNodes": 20,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 14.244,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2006.0459999999694,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.038999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 488.86000000000007,
"heapDeltaBytes": 1821096,
"heapUsedBytes": 66420512,
"domNodes": -280,
"jsHeapTotalBytes": 22781952,
"scriptDurationMs": 13.523,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1753.5110000000032,
"styleRecalcs": 78,
"styleRecalcDurationMs": 38.528,
"layouts": 16,
"layoutDurationMs": 4.9350000000000005,
"taskDurationMs": 818.1160000000001,
"heapDeltaBytes": -17864932,
"heapUsedBytes": 46773904,
"domNodes": -279,
"jsHeapTotalBytes": 22519808,
"scriptDurationMs": 89.196,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1749.6720000000323,
"styleRecalcs": 75,
"styleRecalcDurationMs": 37.019999999999996,
"layouts": 16,
"layoutDurationMs": 4.9719999999999995,
"taskDurationMs": 802.394,
"heapDeltaBytes": -3408576,
"heapUsedBytes": 61079108,
"domNodes": 60,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 100.08600000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 1405.9540000000084,
"styleRecalcs": 17,
"styleRecalcDurationMs": 27.674000000000003,
"layouts": 13,
"layoutDurationMs": 10.831,
"taskDurationMs": 899.9989999999998,
"heapDeltaBytes": 31099336,
"heapUsedBytes": 97984512,
"domNodes": 13673,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 33.602999999999994,
"eventListeners": 2375,
"totalBlockingTimeMs": 120,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8281.011999999975,
"styleRecalcs": 250,
"styleRecalcDurationMs": 40.893,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4543.344,
"heapDeltaBytes": 12710720,
"heapUsedBytes": 72286336,
"domNodes": -279,
"jsHeapTotalBytes": 7110656,
"scriptDurationMs": 1399.286,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8268.674000000032,
"styleRecalcs": 250,
"styleRecalcDurationMs": 46.709999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4352.904,
"heapDeltaBytes": 12273384,
"heapUsedBytes": 72092296,
"domNodes": -284,
"jsHeapTotalBytes": 6324224,
"scriptDurationMs": 1318.775,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17961.38400000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17936.709,
"heapDeltaBytes": -33046944,
"heapUsedBytes": 165734060,
"domNodes": -8312,
"jsHeapTotalBytes": -11210752,
"scriptDurationMs": 560.172,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17709.142999999927,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17654.626,
"heapDeltaBytes": -55862020,
"heapUsedBytes": 170678208,
"domNodes": -8312,
"jsHeapTotalBytes": -5185536,
"scriptDurationMs": 552.766,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 21828.889999999945,
"styleRecalcs": 151,
"styleRecalcDurationMs": 21.88000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21788.076,
"heapDeltaBytes": -40516204,
"heapUsedBytes": 166369768,
"domNodes": -8312,
"jsHeapTotalBytes": -11476992,
"scriptDurationMs": 963.2460000000001,
"eventListeners": -16379,
"totalBlockingTimeMs": 485,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21066.301999999952,
"styleRecalcs": 145,
"styleRecalcDurationMs": 19.131000000000007,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21041.795000000002,
"heapDeltaBytes": -49633068,
"heapUsedBytes": 159373808,
"domNodes": -8312,
"jsHeapTotalBytes": -11177984,
"scriptDurationMs": 862.406,
"eventListeners": -16383,
"totalBlockingTimeMs": 358,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 449.27999999998747,
"styleRecalcs": 13,
"styleRecalcDurationMs": 17.211000000000002,
"layouts": 2,
"layoutDurationMs": 0.3499999999999998,
"taskDurationMs": 100.73700000000001,
"heapDeltaBytes": 5058104,
"heapUsedBytes": 68554600,
"domNodes": 126,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.055,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 105.61299999994844,
"styleRecalcs": 8,
"styleRecalcDurationMs": 15.578,
"layouts": 2,
"layoutDurationMs": 1.0929999999999997,
"taskDurationMs": 74.974,
"heapDeltaBytes": 3073336,
"heapUsedBytes": 66737776,
"domNodes": 110,
"jsHeapTotalBytes": 2621440,
"scriptDurationMs": 4.818999999999999,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
waitForDraftIndexUpdatedSince assumes a saved workflow; this test runs on the default temporary one, so the index timed out. Assert the draft content directly, which is both the thing under test and a debounce-safe wait.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #15069 +/- ##
==========================================
- Coverage 81.32% 81.18% -0.15%
==========================================
Files 1873 1882 +9
Lines 106556 107161 +605
Branches 33382 33575 +193
==========================================
+ Hits 86661 86996 +335
- Misses 19549 19791 +242
- Partials 346 374 +28
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 37 files with indirect coverage changes 🚀 New features to boost your workflow:
|
The e2e environment does not have Comfy.Workflow.Persist on, so no draft was ever written and the poll could not pass. Set it explicitly, matching subgraphDraftPositions and workflowPersistence, and give the test the same 30s budget those use for a reload round trip.
dragAndDropFile defaults waitForUpload to false, so the test read the optimistic value onUploadStart writes rather than the one the upload commits, then searched the draft for a value that was never persisted.
onUploadStart already sets the widget to the local filename, so by the time onUploadComplete ran, oldValue equalled the committed value in the ordinary case where the server keeps the name — the equality guard meant captureCanvasState never fired and no draft was written. captureCanvasState already no-ops on an unchanged graph, so the guard only suppressed it. The e2e passed regardless because the node-add and the upload landed in one 512ms persist debounce; it only failed once SLOW_MO separated them. Assert on the uploaded filename rather than on the value changing so a re-run against a server that already holds the file still exercises the path, and delete the upload afterwards — it was leaking into the shard and flipping the Load Image combo arrows in loadWorkflowInMedia's screenshots.
The upload now marks the workflow modified, which is correct, so this test's re-baseline had to actually clear the flag rather than rely on it never having been set.
jaeone94
left a comment
There was a problem hiding this comment.
The fix is sound and lands at the right layer. The unconditional captureCanvasState() is the correct call here — since onUploadStart optimistically writes the filename, an oldValue !== guard (as in createAssetWidget) would skip the capture in exactly the server-keeps-the-filename case this PR fixes, and graphEqual inside captureCanvasState already makes the redundant call a no-op. Verified the new unit tests fail with the fix line reverted, and that updateModified() after reset() in the other spec is necessary (reset only re-baselines initialState).
Two small suggestions inline; neither blocks.
| dropPosition: { x, y }, | ||
| waitForUpload: true | ||
| }) | ||
| comfyFiles.deleteAfterTest({ filename: DROPPED_FILE, type: 'input' }) |
There was a problem hiding this comment.
Suggestion: drop this deleteAfterTest call. image64x64.webp is a shared fixture uploaded by six other specs (imagePreview, glslPreview, subgraphPromotion, maskEditorLoadSave, load3d, assetDeleteClearsLoadImage), and CI runs fullyParallel with 2 workers — deleting it from the server-global input folder mid-run can 404 another worker's preview-image fetch. The comment above already notes this test stays correct whether or not the file is left behind, so the deletion buys nothing here.
| describe('useImageUploadWidget', () => { | ||
| beforeEach(() => { | ||
| mocks.capturedUploadOptions = undefined | ||
| mocks.captureCanvasState.mockClear() |
There was a problem hiding this comment.
Suggestion: this line is redundant — vite.config.mts sets mockReset: true globally (line 744), so every mock is reset before each test. The sibling vi.fn()s in mocks don't get this treatment either.
Drop a new image on a Load Image node, reload the browser without saving — the node comes back with the previous image.
Intended behaviour
It should survive.
Comfy.Workflow.Persistdefaults totrue(coreSettings.ts:1129) anduseWorkflowPersistenceV2writes a localStorage draft on everygraphChanged, debounced 512ms. Autosave beingoffby default is a red herring — the draft, not autosave, is what restores a page reload. So this is a bug, not a wrong expectation.Root cause
graphChangedis dispatched from exactly one place:ChangeTracker.updateModified(changeTracker.ts:393), reachable only viacaptureCanvasState(). Every caller ofcaptureCanvasStateregistered inChangeTracker.init()is a user-input hook —keyup,mouseup(:587),LGraphCanvas.processMouseUp,ContextMenu.close, litegraph change transactions.HTML5 drag-and-drop emits no
mousedown/mouseup, and the upload resolves asynchronously after the drop gesture ends. So whenuseImageUploadWidget'sonUploadCompletecommits the new value with a bare property assignment, nothing nudges the tracker:activeStateis never refreshed,isModifiedstays false,graphChangednever fires, the draft is never rewritten. On reload the draft still holds the old filename.The file picker has the same gap; it's just less reproducible, because a later stray click anywhere on the page happens to flush it.
createAssetWidget.ts:105-107already does exactly this for the asset browser.useImageUploadWidget's commit block was the same shape minus that call.Change
Capture canvas state when the committed value actually differs, mirroring
createAssetWidget.Regression coverage
Red commit first (
bed706e0d7).browser_tests/tests/loadImageUploadPersistence.spec.ts— drop a file on a Load Image node, wait for the draft index to update, reload, assert the widget still holds the dropped value.Scope
One call in the frontend commit path. No API, schema, or backend contract. Independent of the assets rework.
Notes for review
useNodeImageUpload.ts:109before the upload and is not restored when the upload fails, so a failed drop leaves the node blank — that's the "old image disappears" half and wants its own PR.pagehide) fixes a different window in the same mechanism and is complementary, not overlapping.