Repository navigation
fix: persist workflow drafts across page refresh - #14575
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019fc29a-b52b-747c-8d2c-1b994ea9ea65 Co-authored-by: Amp <amp@ampcode.com>
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎭 Playwright: ✅ 1781 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 8.21 MB gzip 🔴 +45 BDetailsSummary
Category Glance App Entry Points — 3.64 kB (baseline 3.64 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.29 MB (baseline 1.29 MB) • 🔴 +192 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed / 1 unchanged Views & Navigation — 111 kB (baseline 111 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 16 unchanged Panels & Settings — 551 kB (baseline 551 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 26 unchanged User & Accounts — 28.7 kB (baseline 28.7 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 10 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 7 unchanged UI Components — 70 kB (baseline 70 kB) • ⚪ 0 BReusable component library chunks Status: 15 unchanged Data & Services — 3.45 MB (baseline 3.45 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 17 unchanged Utilities & Hooks — 386 kB (baseline 386 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 36 unchanged Vendor & Third-Party — 15.7 MB (baseline 15.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 12.8 MB (baseline 12.8 MB) • ⚪ 0 BBundles that do not match a named category
Status: 1 added / 1 removed / 280 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-02T14:34:08.607Z",
"gitSha": "901ec63d2b2d521b843e99d894c7d4e79628ada9",
"branch": "jaewon/fe-1484-workflow-drafts-persist-refresh",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2108.517000000006,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.9640000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 669.113,
"heapDeltaBytes": 5061912,
"heapUsedBytes": 73092552,
"domNodes": 6,
"jsHeapTotalBytes": 20049920,
"scriptDurationMs": 26.24,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2035.0639999999203,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.727,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 587.735,
"heapDeltaBytes": 4996248,
"heapUsedBytes": 73161688,
"domNodes": 18,
"jsHeapTotalBytes": 19787776,
"scriptDurationMs": 24.417,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1903.6689999999794,
"styleRecalcs": 75,
"styleRecalcDurationMs": 40.181,
"layouts": 12,
"layoutDurationMs": 3.262,
"taskDurationMs": 974.67,
"heapDeltaBytes": -14845784,
"heapUsedBytes": 53246564,
"domNodes": -284,
"jsHeapTotalBytes": 21225472,
"scriptDurationMs": 134.75500000000002,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1923.0810000000247,
"styleRecalcs": 78,
"styleRecalcDurationMs": 46.159,
"layouts": 12,
"layoutDurationMs": 4.122,
"taskDurationMs": 996.4889999999999,
"heapDeltaBytes": -18393624,
"heapUsedBytes": 49476880,
"domNodes": -278,
"jsHeapTotalBytes": 19914752,
"scriptDurationMs": 137.42000000000002,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1754.8470000000407,
"styleRecalcs": 31,
"styleRecalcDurationMs": 20.445999999999998,
"layouts": 6,
"layoutDurationMs": 0.7620000000000001,
"taskDurationMs": 467.593,
"heapDeltaBytes": 7970456,
"heapUsedBytes": 75920736,
"domNodes": 78,
"jsHeapTotalBytes": 21098496,
"scriptDurationMs": 27.385999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1756.0060000000703,
"styleRecalcs": 32,
"styleRecalcDurationMs": 20.328999999999997,
"layouts": 6,
"layoutDurationMs": 0.702,
"taskDurationMs": 473.84700000000004,
"heapDeltaBytes": 7942128,
"heapUsedBytes": 75774168,
"domNodes": 78,
"jsHeapTotalBytes": 20312064,
"scriptDurationMs": 27.374999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 629.4340000000034,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.641,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 425.216,
"heapDeltaBytes": -12226644,
"heapUsedBytes": 55640776,
"domNodes": 20,
"jsHeapTotalBytes": 22147072,
"scriptDurationMs": 63.68199999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 656.2189999999646,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.549,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 411.6960000000001,
"heapDeltaBytes": -11806672,
"heapUsedBytes": 55965156,
"domNodes": 18,
"jsHeapTotalBytes": 22147072,
"scriptDurationMs": 65.09599999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2041.4089999999874,
"styleRecalcs": 9,
"styleRecalcDurationMs": 10.385000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 826.888,
"heapDeltaBytes": 7933604,
"heapUsedBytes": 66766324,
"domNodes": -281,
"jsHeapTotalBytes": 4780032,
"scriptDurationMs": 134.31799999999998,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2034.7370000000637,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.210000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 842.9470000000001,
"heapDeltaBytes": 8440624,
"heapUsedBytes": 67393380,
"domNodes": -283,
"jsHeapTotalBytes": 4780032,
"scriptDurationMs": 131.553,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2437.1469999999817,
"styleRecalcs": 68,
"styleRecalcDurationMs": 14.289000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1506.539,
"heapDeltaBytes": 7051180,
"heapUsedBytes": 67303820,
"domNodes": -285,
"jsHeapTotalBytes": 5267456,
"scriptDurationMs": 551.307,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2284.391000000028,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.964999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1409.888,
"heapDeltaBytes": 6657192,
"heapUsedBytes": 66426804,
"domNodes": -285,
"jsHeapTotalBytes": 5267456,
"scriptDurationMs": 462.67400000000004,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3672.0599999999877,
"styleRecalcs": 63,
"styleRecalcDurationMs": 16.564,
"layouts": 60,
"layoutDurationMs": 7.661000000000001,
"taskDurationMs": 1749.7169999999999,
"heapDeltaBytes": -4553760,
"heapUsedBytes": 57123268,
"domNodes": -290,
"jsHeapTotalBytes": 6877184,
"scriptDurationMs": 620.5799999999999,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3245.2899999999545,
"styleRecalcs": 64,
"styleRecalcDurationMs": 14.847,
"layouts": 60,
"layoutDurationMs": 7.766,
"taskDurationMs": 1610.961,
"heapDeltaBytes": 24335236,
"heapUsedBytes": 86482832,
"domNodes": 10,
"jsHeapTotalBytes": 8388608,
"scriptDurationMs": 571.878,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2034.0289999999754,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.276000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 846.56,
"heapDeltaBytes": 7694404,
"heapUsedBytes": 68627912,
"domNodes": -284,
"jsHeapTotalBytes": 4255744,
"scriptDurationMs": 135.766,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2035.6959999999162,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.664999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 824.974,
"heapDeltaBytes": 8288160,
"heapUsedBytes": 69267580,
"domNodes": -284,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 132.69799999999998,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 674.4800000000168,
"styleRecalcs": 48,
"styleRecalcDurationMs": 13.677,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 442.23900000000003,
"heapDeltaBytes": -10920532,
"heapUsedBytes": 57278916,
"domNodes": 22,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 126.31,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 644.382999999948,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.398,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.19,
"heapDeltaBytes": -11377000,
"heapUsedBytes": 56633680,
"domNodes": 20,
"jsHeapTotalBytes": 21884928,
"scriptDurationMs": 127.031,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2030.3739999999948,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.135000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 604.1,
"heapDeltaBytes": -21995344,
"heapUsedBytes": 45831640,
"domNodes": 18,
"jsHeapTotalBytes": 19914752,
"scriptDurationMs": 21.756,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2035.900999999967,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.463000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 638.817,
"heapDeltaBytes": -22240856,
"heapUsedBytes": 45834204,
"domNodes": 18,
"jsHeapTotalBytes": 20176896,
"scriptDurationMs": 23.161999999999995,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1745.7019999999943,
"styleRecalcs": 76,
"styleRecalcDurationMs": 40.449,
"layouts": 16,
"layoutDurationMs": 4.883,
"taskDurationMs": 901.535,
"heapDeltaBytes": -21685900,
"heapUsedBytes": 46189556,
"domNodes": 20,
"jsHeapTotalBytes": 20701184,
"scriptDurationMs": 103.519,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1752.1740000000818,
"styleRecalcs": 74,
"styleRecalcDurationMs": 40.887,
"layouts": 16,
"layoutDurationMs": 4.654,
"taskDurationMs": 917.7089999999998,
"heapDeltaBytes": -19915804,
"heapUsedBytes": 47968552,
"domNodes": -283,
"jsHeapTotalBytes": 21225472,
"scriptDurationMs": 108.798,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1400.8680000000027,
"styleRecalcs": 17,
"styleRecalcDurationMs": 33.555,
"layouts": 13,
"layoutDurationMs": 13.659999999999998,
"taskDurationMs": 1041.329,
"heapDeltaBytes": 30932480,
"heapUsedBytes": 99004060,
"domNodes": 13673,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 42.32899999999999,
"eventListeners": 2371,
"totalBlockingTimeMs": 146,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 9015.045999999984,
"styleRecalcs": 250,
"styleRecalcDurationMs": 42.24400000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5080.124000000001,
"heapDeltaBytes": 20093168,
"heapUsedBytes": 78906776,
"domNodes": -279,
"jsHeapTotalBytes": 7331840,
"scriptDurationMs": 1581.1100000000001,
"eventListeners": -126,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8838.10399999993,
"styleRecalcs": 251,
"styleRecalcDurationMs": 40.263999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5032.0019999999995,
"heapDeltaBytes": 18066556,
"heapUsedBytes": 76832424,
"domNodes": -279,
"jsHeapTotalBytes": 6807552,
"scriptDurationMs": 1513.5939999999998,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17828.434000000016,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17801.092,
"heapDeltaBytes": -45006356,
"heapUsedBytes": 167145880,
"domNodes": -8312,
"jsHeapTotalBytes": -9117696,
"scriptDurationMs": 635.927,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 17849.593000000026,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17831.026,
"heapDeltaBytes": -45034008,
"heapUsedBytes": 166929688,
"domNodes": -8312,
"jsHeapTotalBytes": -11214848,
"scriptDurationMs": 553.948,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 21926.737,
"styleRecalcs": 157,
"styleRecalcDurationMs": 22.114000000000022,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21879.95,
"heapDeltaBytes": -31818376,
"heapUsedBytes": 177296396,
"domNodes": -8312,
"jsHeapTotalBytes": -15966208,
"scriptDurationMs": 984.9510000000001,
"eventListeners": -16383,
"totalBlockingTimeMs": 451,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21806.740999999987,
"styleRecalcs": 155,
"styleRecalcDurationMs": 21.272000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21771.372999999996,
"heapDeltaBytes": -55473172,
"heapUsedBytes": 154152568,
"domNodes": -8313,
"jsHeapTotalBytes": -11440128,
"scriptDurationMs": 910.9159999999999,
"eventListeners": -16383,
"totalBlockingTimeMs": 412,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 473.1310000000235,
"styleRecalcs": 11,
"styleRecalcDurationMs": 18.275,
"layouts": 3,
"layoutDurationMs": 0.6050000000000001,
"taskDurationMs": 122.54,
"heapDeltaBytes": -16035992,
"heapUsedBytes": 50974500,
"domNodes": 128,
"jsHeapTotalBytes": 7991296,
"scriptDurationMs": 11.539000000000001,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 490.28199999997923,
"styleRecalcs": 16,
"styleRecalcDurationMs": 29.391999999999996,
"layouts": 4,
"layoutDurationMs": 1.51,
"taskDurationMs": 138.81799999999998,
"heapDeltaBytes": -16037944,
"heapUsedBytes": 50859544,
"domNodes": 121,
"jsHeapTotalBytes": 7467008,
"scriptDurationMs": 12.128000000000002,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
📝 WalkthroughWalkthroughThe workflow persistence composable flushes pending saves on ChangesWorkflow persistence
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.ts`:
- Around line 625-648: Add a disposal-focused test near the existing pagehide
coverage for useWorkflowPersistenceV2: queue a workflow edit, unmount or dispose
the composable before dispatching pagehide, then assert localStorage.getItem for
the workflow’s StorageKeys.draftPayload remains null. Keep the existing
mounted-pagehide flush behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 4d2f2997-b200-4d5e-a71b-5c7b6e7cda16
📒 Files selected for processing (2)
src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.tssrc/platform/workflow/persistence/composables/useWorkflowPersistenceV2.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019fc29a-b52b-747c-8d2c-1b994ea9ea65 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.ts`:
- Around line 656-658: Update the test setup around graphChangedHandler to
explicitly assert that the handler is registered before invoking it, rather than
using optional chaining. Ensure the graph edit triggers a pending write before
disposal, so the subsequent no-payload assertion verifies disposal behavior
instead of passing through a skipped handler.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ce6bc2d2-cffc-4a9f-aaaf-051df7f7d142
📒 Files selected for processing (1)
src/platform/workflow/persistence/composables/useWorkflowPersistenceV2.test.ts
Requested disposal coverage was added in ec65312 and the review thread is resolved.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #14575 +/- ##
==========================================
- Coverage 79.14% 79.14% -0.01%
==========================================
Files 1769 1769
Lines 113307 113310 +3
Branches 35242 35241 -1
==========================================
+ Hits 89678 89680 +2
+ Misses 23092 23088 -4
- Partials 537 542 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Verification — AS IS / TO BEScenario: in a personal workspace, persist one node, add a second node, then refresh after 80 ms (before the 512 ms persistence debounce fires).
|
Amp-Thread-ID: https://ampcode.com/threads/T-019fc29a-b52b-747c-8d2c-1b994ea9ea65 Co-authored-by: Amp <amp@ampcode.com>
The false-positive test setup was corrected in 2d22f41 and the review thread is resolved.
Amp-Thread-ID: https://ampcode.com/threads/T-019fc29a-b52b-747c-8d2c-1b994ea9ea65 Co-authored-by: Amp <amp@ampcode.com>
|
@dante01yoon Successfully backported to #15335 |
|
@dante01yoon Successfully backported to #15336 |
…y-Org#15069) 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.Persist` defaults to `true` (`coreSettings.ts:1129`) and `useWorkflowPersistenceV2` writes a localStorage draft on every `graphChanged`, debounced 512ms. Autosave being `off` by 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 `graphChanged` is dispatched from exactly one place: `ChangeTracker.updateModified` (`changeTracker.ts:393`), reachable only via `captureCanvasState()`. Every caller of `captureCanvasState` registered in `ChangeTracker.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 when `useImageUploadWidget`'s `onUploadComplete` commits the new value with a bare property assignment, nothing nudges the tracker: `activeState` is never refreshed, `isModified` stays false, `graphChanged` never 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-107` already 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`). - Unit: an upload that changes the combo value captures canvas state; one that doesn't, doesn't. - E2E: `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 - Reported in FE-1425. Related but **not** fixed here: the preview is nulled at `useNodeImageUpload.ts:109` before 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. - Adjacent open work worth sequencing against: Comfy-Org#14575 (flush pending draft writes on `pagehide`) fixes a different window in the same mechanism and is complementary, not overlapping. - The e2e was not executed locally (no ComfyUI backend on this machine); unit tests and typecheck were. --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org>

Summary
Flush pending debounced workflow draft writes when the page unloads so recent edits survive refresh.
Root cause
Workflow graph writes are debounced by 512 ms. If a user refreshed during that window, the page was destroyed before the pending write ran, so the next load restored the previous draft. The persistence composable already flushed pending writes during workspace transitions, but it had no browser lifecycle flush.
How we handle it
window.pagehideinstead of adding a separate unload storage path.pagehidelistener during scope disposal before cancelling the debounce.Regression coverage
pagehide.Review Focus
The unload path uses the same persistence operation and guards as normal graph changes and workspace transitions.
Verification
Personal workspace scenario: persist one node, add a second node, then refresh after 80 ms (before the 512 ms debounce fires).
pagehideflushes the pending write; both nodes return.