Repository navigation
fix(workflow): repair the A1111 import lifecycle and report broken installs accurately - #14556
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1783 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle: 8.24 MB gzip 🔴 +311 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.34 MB (baseline 1.34 MB) • ⚪ 0 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: 12 added / 12 removed / 4 unchanged Panels & Settings — 551 kB (baseline 551 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 15 unchanged User & Accounts — 28.7 kB (baseline 28.7 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 3 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 6 added / 6 removed / 1 unchanged UI Components — 70 kB (baseline 70 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 9 unchanged Data & Services — 3.46 MB (baseline 3.46 MB) • 🔴 +508 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 386 kB (baseline 386 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 19 added / 19 removed / 17 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) • 🔴 +160 BBundles that do not match a named category
Status: 78 added / 78 removed / 203 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-04T03:04:58.293Z",
"gitSha": "b9ae7dfb7ecdad2539e2e873e631776d30c397f8",
"branch": "jaeone94/prA-a2-a1111-toast",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2178.4830000000284,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.5969999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 540.4879999999999,
"heapDeltaBytes": 5427956,
"heapUsedBytes": 69412544,
"domNodes": 16,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 21.839000000000002,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2017.2210000000632,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.697,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 485.03,
"heapDeltaBytes": 5406156,
"heapUsedBytes": 69372888,
"domNodes": 18,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 19.052,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1843.2320000000004,
"styleRecalcs": 74,
"styleRecalcDurationMs": 39.224999999999994,
"layouts": 12,
"layoutDurationMs": 3.6690000000000005,
"taskDurationMs": 826.2090000000001,
"heapDeltaBytes": -13984876,
"heapUsedBytes": 50006396,
"domNodes": -280,
"jsHeapTotalBytes": 24100864,
"scriptDurationMs": 130.682,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1906.5090000000282,
"styleRecalcs": 77,
"styleRecalcDurationMs": 41.023,
"layouts": 12,
"layoutDurationMs": 3.4069999999999996,
"taskDurationMs": 911.0509999999999,
"heapDeltaBytes": -12685968,
"heapUsedBytes": 51358084,
"domNodes": -281,
"jsHeapTotalBytes": 24625152,
"scriptDurationMs": 126.721,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1756.278000000009,
"styleRecalcs": 32,
"styleRecalcDurationMs": 18.769000000000002,
"layouts": 6,
"layoutDurationMs": 0.6460000000000001,
"taskDurationMs": 393.488,
"heapDeltaBytes": 8288376,
"heapUsedBytes": 72374644,
"domNodes": 78,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 20.429999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1754.8229999999876,
"styleRecalcs": 32,
"styleRecalcDurationMs": 19.214999999999996,
"layouts": 6,
"layoutDurationMs": 0.636,
"taskDurationMs": 384.309,
"heapDeltaBytes": 8340668,
"heapUsedBytes": 72396544,
"domNodes": 77,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 20.703000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 574.8180000000502,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.195999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 385.266,
"heapDeltaBytes": -10941944,
"heapUsedBytes": 53046220,
"domNodes": 18,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 62.044,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 568.4170000000677,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.8229999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 372.307,
"heapDeltaBytes": -10833548,
"heapUsedBytes": 52970840,
"domNodes": 16,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 60.964000000000006,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2011.7480000000114,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.402000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 698.5559999999999,
"heapDeltaBytes": 4389616,
"heapUsedBytes": 64228520,
"domNodes": -283,
"jsHeapTotalBytes": 2732032,
"scriptDurationMs": 112.44599999999998,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2041.5100000000166,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.463000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 711.3600000000001,
"heapDeltaBytes": 6923692,
"heapUsedBytes": 66171700,
"domNodes": -280,
"jsHeapTotalBytes": 2732032,
"scriptDurationMs": 118.418,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2351.725999999985,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.077,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1377.402,
"heapDeltaBytes": 5592144,
"heapUsedBytes": 65971228,
"domNodes": -283,
"jsHeapTotalBytes": 3973120,
"scriptDurationMs": 484.33099999999996,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2221.144000000095,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.333999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1334.471,
"heapDeltaBytes": 1558184,
"heapUsedBytes": 62011364,
"domNodes": -284,
"jsHeapTotalBytes": 3710976,
"scriptDurationMs": 433.639,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3231.903999999986,
"styleRecalcs": 64,
"styleRecalcDurationMs": 14.147,
"layouts": 60,
"layoutDurationMs": 7.448,
"taskDurationMs": 1562.689,
"heapDeltaBytes": -452980,
"heapUsedBytes": 62532368,
"domNodes": -289,
"jsHeapTotalBytes": 6139904,
"scriptDurationMs": 554.284,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3279.0339999999105,
"styleRecalcs": 66,
"styleRecalcDurationMs": 16.160999999999998,
"layouts": 60,
"layoutDurationMs": 7.274,
"taskDurationMs": 1588.54,
"heapDeltaBytes": 2468864,
"heapUsedBytes": 64467304,
"domNodes": -287,
"jsHeapTotalBytes": 6664192,
"scriptDurationMs": 551.982,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2055.0160000000233,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.616000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 702.561,
"heapDeltaBytes": 7589256,
"heapUsedBytes": 67863592,
"domNodes": -282,
"jsHeapTotalBytes": 3256320,
"scriptDurationMs": 114.61399999999999,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2041.4580000000342,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.520999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 686.118,
"heapDeltaBytes": 7144372,
"heapUsedBytes": 68948904,
"domNodes": -285,
"jsHeapTotalBytes": 3780608,
"scriptDurationMs": 113.454,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 595.8059999999819,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.886999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 418.89799999999997,
"heapDeltaBytes": -10721220,
"heapUsedBytes": 53261752,
"domNodes": 20,
"jsHeapTotalBytes": 26476544,
"scriptDurationMs": 122.31400000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 589.8730000000114,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.633999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 412.68399999999997,
"heapDeltaBytes": -10772048,
"heapUsedBytes": 53402936,
"domNodes": 18,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 123.77499999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2026.6869999999813,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.195999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 513.3760000000001,
"heapDeltaBytes": -18453380,
"heapUsedBytes": 45617872,
"domNodes": 18,
"jsHeapTotalBytes": 23576576,
"scriptDurationMs": 15.771,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2006.2689999999748,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.364,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.16700000000003,
"heapDeltaBytes": 5199724,
"heapUsedBytes": 69289352,
"domNodes": 18,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 16.681,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1742.853000000025,
"styleRecalcs": 77,
"styleRecalcDurationMs": 36.388000000000005,
"layouts": 16,
"layoutDurationMs": 3.935,
"taskDurationMs": 849.811,
"heapDeltaBytes": -17389884,
"heapUsedBytes": 46552160,
"domNodes": -279,
"jsHeapTotalBytes": 24625152,
"scriptDurationMs": 95.664,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1725.9679999999662,
"styleRecalcs": 74,
"styleRecalcDurationMs": 36.645,
"layouts": 16,
"layoutDurationMs": 4.747999999999999,
"taskDurationMs": 835.8,
"heapDeltaBytes": -16101900,
"heapUsedBytes": 47847260,
"domNodes": -282,
"jsHeapTotalBytes": 24363008,
"scriptDurationMs": 96.251,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1416.9799999999668,
"styleRecalcs": 17,
"styleRecalcDurationMs": 30.121999999999996,
"layouts": 13,
"layoutDurationMs": 12.379999999999999,
"taskDurationMs": 965.5740000000002,
"heapDeltaBytes": 29054172,
"heapUsedBytes": 98003396,
"domNodes": 13673,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 43.555,
"eventListeners": 2371,
"totalBlockingTimeMs": 139,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8657.070999999974,
"styleRecalcs": 251,
"styleRecalcDurationMs": 40.603,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4808.041,
"heapDeltaBytes": 7843932,
"heapUsedBytes": 66632040,
"domNodes": -279,
"jsHeapTotalBytes": 7643136,
"scriptDurationMs": 1531.816,
"eventListeners": -163,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8508.907000000021,
"styleRecalcs": 249,
"styleRecalcDurationMs": 36.909,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4660.226,
"heapDeltaBytes": 14169996,
"heapUsedBytes": 73556864,
"domNodes": -284,
"jsHeapTotalBytes": 3973120,
"scriptDurationMs": 1445.5010000000002,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17384.506999999983,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17347.817,
"heapDeltaBytes": -41147676,
"heapUsedBytes": 166047220,
"domNodes": -8312,
"jsHeapTotalBytes": -9904128,
"scriptDurationMs": 582.906,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17105.957999999988,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17091.099,
"heapDeltaBytes": -57226204,
"heapUsedBytes": 166730192,
"domNodes": -8312,
"jsHeapTotalBytes": -8331264,
"scriptDurationMs": 547.645,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20863.24199999996,
"styleRecalcs": 141,
"styleRecalcDurationMs": 17.405000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20823.359000000004,
"heapDeltaBytes": -29787460,
"heapUsedBytes": 166476016,
"domNodes": -8312,
"jsHeapTotalBytes": -9641984,
"scriptDurationMs": 897.4960000000001,
"eventListeners": -16381,
"totalBlockingTimeMs": 252,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20461.486000000037,
"styleRecalcs": 139,
"styleRecalcDurationMs": 17.587000000000018,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20437.425,
"heapDeltaBytes": -38933756,
"heapUsedBytes": 166290748,
"domNodes": -8312,
"jsHeapTotalBytes": -9117696,
"scriptDurationMs": 864.6229999999999,
"eventListeners": -16383,
"totalBlockingTimeMs": 192,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 466.3060000000314,
"styleRecalcs": 20,
"styleRecalcDurationMs": 23.611000000000004,
"layouts": 3,
"layoutDurationMs": 1.4110000000000003,
"taskDurationMs": 125.89800000000001,
"heapDeltaBytes": 5495960,
"heapUsedBytes": 68638960,
"domNodes": 158,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 12.725,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 464.30099999997765,
"styleRecalcs": 13,
"styleRecalcDurationMs": 18.465000000000003,
"layouts": 3,
"layoutDurationMs": 0.755,
"taskDurationMs": 109.042,
"heapDeltaBytes": 5080420,
"heapUsedBytes": 68082836,
"domNodes": 121,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 10.245999999999999,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
📝 WalkthroughWalkthroughWorkflow loading now falls back to A1111 parameter imports when embedded workflows are malformed. Import results identify invalid data and missing core nodes. Failed imports preserve the current graph. Rejected file loads display errors and reset the file input. ChangesWorkflow import error handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant FileInput
participant ComfyApp
participant importA1111
participant Canvas
participant WorkflowServices
FileInput->>ComfyApp: handleFile
ComfyApp->>importA1111: await import parameters
importA1111-->>ComfyApp: import status
importA1111->>Canvas: clear and import graph on success
ComfyApp->>WorkflowServices: await afterLoadNewGraph
ComfyApp-->>FileInput: resolve or reject
FileInput->>FileInput: display error and reset value
Possibly related PRs
Suggested labels: Suggested reviewers: 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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/scripts/pnginfo.ts (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winOutcome union type is duplicated instead of shared.
src/scripts/pnginfo.tsdeclares the'imported' | 'not-a1111' | 'core-nodes-unavailable'union inline as theimportA1111return type.src/scripts/app.test.tsindependently re-declares the identical union inside the mock's type signature. One root cause: no single source of truth for this status contract.
src/scripts/pnginfo.ts#L183-187: export a named type, for exampleexport type A1111ImportOutcome = 'imported' | 'not-a1111' | 'core-nodes-unavailable', and use it as the return type.src/scripts/app.test.ts#L79-92: importA1111ImportOutcome(or derive the mock type viaParameters<typeof importA1111>/ReturnType<typeof importA1111>) instead of retyping the union and thegraphparameter manually.🤖 Prompt for 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. In `@src/scripts/pnginfo.ts` at line 1, Define and export a shared A1111 import outcome type near importA1111 in pnginfo.ts, then use it as that function’s return type. Update the app.test.ts mock typing to import and reuse A1111ImportOutcome (and the existing importA1111 signature where appropriate) instead of duplicating the outcome union and graph parameter type.
🤖 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/scripts/app.test.ts`:
- Around line 79-92: Update the mockImportA1111 typing in the test setup to
reuse the existing importA1111 outcome type exported from pnginfo.ts instead of
redeclaring the 'imported' | 'not-a1111' | 'core-nodes-unavailable' union.
Preserve the current graph, parameters, callback, and Promise signatures while
referencing the shared type.
In `@src/scripts/app.ts`:
- Around line 2059-2071: Update the outcome handling after importA1111 in the
graph-loading flow to explicitly accept the 'imported' result before calling
useWorkflowService().afterLoadNewGraph. Preserve the existing handling for
'core-nodes-unavailable' and 'not-a1111', and make any unrecognized outcome fail
loudly rather than falling through to the success path.
In `@src/scripts/pnginfo.ts`:
- Around line 183-187: Define and export a named outcome type for the three
`importA1111` status literals, then use that alias in the function’s `Promise`
return type and update the corresponding mock declaration in `app.test.ts` to
reuse it instead of repeating the union.
---
Outside diff comments:
In `@src/scripts/pnginfo.ts`:
- Line 1: Define and export a shared A1111 import outcome type near importA1111
in pnginfo.ts, then use it as that function’s return type. Update the
app.test.ts mock typing to import and reuse A1111ImportOutcome (and the existing
importA1111 signature where appropriate) instead of duplicating the outcome
union and graph parameter type.
🪄 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: 176c2a07-bae2-43e3-884f-18de7d5c41a9
📒 Files selected for processing (7)
src/locales/en/main.jsonsrc/scripts/app.test.tssrc/scripts/app.tssrc/scripts/pnginfo.test.tssrc/scripts/pnginfo.tssrc/scripts/ui.test.tssrc/scripts/ui.ts
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #14556 +/- ##
==========================================
+ Coverage 79.12% 79.17% +0.04%
==========================================
Files 1763 1786 +23
Lines 112306 115049 +2743
Branches 35930 37048 +1118
==========================================
+ Hits 88862 91087 +2225
- Misses 22916 23410 +494
- Partials 528 552 +24
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 94 files with indirect coverage changes 🚀 New features to boost your workflow:
|
The three-literal outcome union was written out twice: once as importA1111's return type and again in the app.test.ts mock signature. Alias it in pnginfo.ts and type the mock as `typeof importA1111` so the mock tracks the real signature.
|
Applied the type-duplication finding, skipped the exhaustiveness one. Applied. Aliased the union as Kept the alias unexported: Skipped — explicit |
christian-byrne
left a comment
There was a problem hiding this comment.
Out-of-diff findings (lines not changed by this PR):
issue: afterLoadNewGraph still unawaited in loadApiJson (app.ts:2273)
loadApiJson is not async and calls useWorkflowService().afterLoadNewGraph(...) without await. The PR fixes the A1111 path but leaves this as a fire-and-forget -- rejections are silently swallowed. handleFile at line 2048 does this.loadApiJson(promptObj, fileName); return with no opportunity to await. The lifecycle guarantee the PR restores for A1111 is absent for the API JSON import path.
note: Pre-fix severity for core-nodes-unavailable was worse than described
The PR description says the old behavior was "shows the wrong message." The actual behavior: afterLoadNewGraph fired unconditionally after the silent void return, registering the unchanged current graph under the dropped A1111 filename as a new workflow tab. The user's open work was silently identity-corrupted (renamed to the dropped file with no feedback). Worth noting for changelog accuracy or backport decisions.
note: "Triple alert" claim in PR description -- at most two alerts on main
The PR description says both the invalid-structure branch and the parse catch called showErrorOnFileLoad "and then fell through to a third call." Tracing main: the final showErrorOnFileLoad at the end of handleFile only fires when parameters is absent -- so when workflow parse fails AND parameters is also absent, there are two calls (catch block + final fallback), not three. The fix is correct (removing the redundant calls), but the description overstates the maximum count.
- Export `A1111ImportOutcome` so callers can use it in type positions. - Log unhandled A1111 parameters only when some remain after the known ignorable keys are deleted, instead of on every successful import. - Type the workflowService mocks from the real service so a signature change fails at compile time. - Use `vi.resetAllMocks()` suite-wide per docs/testing/vitest-patterns.md and drop the per-mock `mockReset()` calls that made isolation uneven. - Assert the message text in the single-error regression test. - Rename the lifecycle test to what it exercises: the callback ordering inside app.ts, not pnginfo's invocation of it, which pnginfo.test.ts covers. - Stub `graph.arrange` in the callback-ordering test so it does not depend on arrange tolerating bare nodes.
|
Both description corrections confirmed against main — you are right on both, and the first one understates the harm in a way that matters for backport. Severity. I verified the pre-fix path at if (parameters && typeof parameters === 'string') {
useWorkflowService().beforeLoadNewGraph()
importA1111(this.rootGraph, parameters) // Promise<void>, not awaited
useWorkflowService().afterLoadNewGraph(
fileName,
this.rootGraph.serialize() as unknown as ComfyWorkflowJSON
)
return
}and inside console.error('Failed to create required nodes for A1111 import')
returnSo there was no user-facing message at all — "shows the wrong message" was wrong twice over. Worth adding: because Alert count. Also right — two, not three. Both PR descriptions are updated. |
main moved `updatePendingWarnings` out of app.ts in #14578 and #14556 landed a workflowService mock in app.test.ts. Both merge without conflict markers in app.ts but leave this branch broken: - restore the `updatePendingWarnings` import; this branch adds a new caller in `showMissingNodesError` that main no longer imports for - point the workflowService mock at the real implementation in the two tests that exercise the load lifecycle itself, so #14556's mock and this branch's lifecycle assertions can coexist
Splits out of #14251. Five lifecycle fixes on the A1111 image-import path. 30 production lines.
What
Dropping an A1111-generated PNG parses its
parametersstring and builds a ComfyUI graph from it. The path had four defects that only show up when something goes wrong, plus one that shows up always:afterLoadNewGraphwas not awaited. It suspends before the active workflow is reassigned, sorootGraph.serialize()on the next line captured the outgoing graph — the new tab was born dirty against a stale baseline.importA1111awaitsapi.getEmbeddings(), which does not checkresp.ok. On a 500 with an HTML body it throws,fileInput.value = ''never runs, the input still holds the file, re-selecting it fires nochangeevent, and Open silently does nothing on every retry. Now:try/catchwith a toast,finallyresets the input.elseand the parsecatcheach calledshowErrorOnFileLoad, then fell through to the final call at the end ofhandleFile. Those two are theelseandcatchof onetry, so the maximum is two alerts, not three.beforeLoadNewGraph()ran before an import that might bail. It callsdomWidgetStore.clear(), and nothing re-registers on a bail path — a workflow with a multiline prompt on screen lost its DOM widget overlays when the user dropped a PNG that did not parse. It now runs immediately before the mutation, and the A1111 path gets the subgraph guardclean()already had.importA1111logged to the console and returnedvoid. Because the call was unawaited,afterLoadNewGraphthen registered the user's unchanged graph under the dropped file's name, afterbeforeLoadNewGraphhad already cleareddomWidgetStore. See below.The message
The seven types this importer needs —
CheckpointLoaderSimple,CLIPSetLastLayer,CLIPTextEncode,KSampler,EmptyLatentImage,VAEDecode,SaveImage— are all core nodes, as areLoraLoaderand the hires chain. Their absence does not mean a node pack is missing. It means the backend did not load, or the install is broken.So this path deliberately writes nothing to the missing-node panel: no card, no entry, no placeholder. A type that was never added to the graph does not belong in a list of nodes missing from the graph, and naming the individual types would read as "install this pack" and send people looking for something that does not exist.
importA1111returnsPromise<'imported' | 'not-a1111' | 'core-nodes-unavailable'>— three string literals, replacingPromise<boolean>. The boolean could not distinguish "bailed and already told the user" from "bailed silently", which is how an ordinary A1111 PNG could vanish with no feedback at all: A1111 omits theNegative prompt:line entirely when the negative prompt is empty.The
core-nodes-unavailablereturn happens before the graph is touched, so a failed import leaves the open workflow intact.pnginfo.test.tsasserts that directly.What this deliberately does not do
pnginfo.tsis +8 −4, with zero re-indentation (git diffandgit diff -wreport the same line count). The nesting in that file is not pretty and it is not this PR's business. An earlier revision restructured it; that diff was 759 lines, ~72% of it re-indentation, and none of it fixed a bug. If it deserves a refactor it deserves a PR where a reviewer sees only that.Verification
6 unit tests across
app.test.ts,pnginfo.test.tsandui.test.ts, each mutation-proved. typecheck, lint, format, knip clean. Full unit suite: only pre-existing timeout flakes, confirmed by re-running the same files at the merge base and getting byte-identical results.Related