[backport core/1.41] fix: 3D asset disappears when switching to image output in app mode#10230
Open
comfy-pr-bot wants to merge 1 commit intocore/1.41from
Open
[backport core/1.41] fix: 3D asset disappears when switching to image output in app mode#10230comfy-pr-bot wants to merge 1 commit intocore/1.41from
comfy-pr-bot wants to merge 1 commit intocore/1.41from
Conversation
…9622) ## Summary Fix 3D asset disappearing when switching between 3D and image outputs in app mode — missing `onUnmounted` cleanup leaked WebGL contexts. ## Changes - **What**: Add `onUnmounted` hook to `Preview3d.vue` that calls `viewer.cleanup()`, releasing the WebGL context when Vue destroys the component via its v-if chain. Add unit tests covering init, cleanup on unmount, and remount behavior. ## Review Focus When switching outputs in app mode, Vue's v-if chain destroys and recreates `Preview3d`. Without `onUnmounted` cleanup, the old `Load3d` instance (WebGL context, RAF loop, ResizeObserver) leaks. After ~8-16 toggles, the browser's WebGL context limit is exhausted and new 3D viewers silently fail to render. <!-- Pipeline-Ticket: e36489d2-a9fb-47ca-9e27-88eb3170836b --> --------- Co-authored-by: Alexander Brown <drjkl@comfy.org>
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 563 passed, 0 failed · 2 flaky📊 Browser Reports
|
📦 Bundle Size
⚡ Performance Report
All metrics
Historical variance (last 10 runs)
Trend (last 10 commits on main)
Raw data{
"timestamp": "2026-03-18T01:13:20.645Z",
"gitSha": "63d79965f4bc9c9af536427479bb5a0971a51671",
"branch": "backport-9622-to-core-1.41",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2007.852000000014,
"styleRecalcs": 123,
"styleRecalcDurationMs": 18.738999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 424.99600000000004,
"heapDeltaBytes": -3600688
},
{
"name": "canvas-idle",
"durationMs": 2028.1610000000114,
"styleRecalcs": 124,
"styleRecalcDurationMs": 21.788999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 390.414,
"heapDeltaBytes": -3735260
},
{
"name": "canvas-idle",
"durationMs": 2038.7710000000538,
"styleRecalcs": 124,
"styleRecalcDurationMs": 21.283000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 384.11899999999997,
"heapDeltaBytes": -3342916
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2057.7480000000037,
"styleRecalcs": 183,
"styleRecalcDurationMs": 57.15699999999999,
"layouts": 12,
"layoutDurationMs": 3.6809999999999996,
"taskDurationMs": 1039.8509999999999,
"heapDeltaBytes": -3495688
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1798.014999999964,
"styleRecalcs": 163,
"styleRecalcDurationMs": 41.779,
"layouts": 12,
"layoutDurationMs": 3.064,
"taskDurationMs": 759.55,
"heapDeltaBytes": -4030132
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1863.0259999999907,
"styleRecalcs": 170,
"styleRecalcDurationMs": 47.173,
"layouts": 12,
"layoutDurationMs": 3.269,
"taskDurationMs": 806.572,
"heapDeltaBytes": -3226076
},
{
"name": "dom-widget-clipping",
"durationMs": 527.9110000000173,
"styleRecalcs": 39,
"styleRecalcDurationMs": 12.662,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 345.40999999999997,
"heapDeltaBytes": 6496776
},
{
"name": "dom-widget-clipping",
"durationMs": 607.0689999999672,
"styleRecalcs": 46,
"styleRecalcDurationMs": 16.315,
"layouts": 1,
"layoutDurationMs": 0.1950000000000001,
"taskDurationMs": 377.185,
"heapDeltaBytes": 8256908
},
{
"name": "dom-widget-clipping",
"durationMs": 580.0100000000157,
"styleRecalcs": 43,
"styleRecalcDurationMs": 13.064000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 347.97599999999994,
"heapDeltaBytes": 7639112
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 578.5220000000209,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.309000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 397.95799999999997,
"heapDeltaBytes": 15267900
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 561.4030000000412,
"styleRecalcs": 71,
"styleRecalcDurationMs": 14.8,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 399.164,
"heapDeltaBytes": 15452840
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 584.0759999999818,
"styleRecalcs": 72,
"styleRecalcDurationMs": 15.207999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 416.674,
"heapDeltaBytes": -8829712
},
{
"name": "subgraph-idle",
"durationMs": 2011.342999999954,
"styleRecalcs": 123,
"styleRecalcDurationMs": 21.332,
"layouts": 1,
"layoutDurationMs": 0.178,
"taskDurationMs": 381.95799999999997,
"heapDeltaBytes": -2990572
},
{
"name": "subgraph-idle",
"durationMs": 1995.6849999999804,
"styleRecalcs": 121,
"styleRecalcDurationMs": 18.647000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 363.01099999999997,
"heapDeltaBytes": -4310540
},
{
"name": "subgraph-idle",
"durationMs": 2011.1279999999851,
"styleRecalcs": 122,
"styleRecalcDurationMs": 17.707,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 361.41900000000004,
"heapDeltaBytes": -3738272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1691.30100000001,
"styleRecalcs": 154,
"styleRecalcDurationMs": 42.157,
"layouts": 16,
"layoutDurationMs": 3.7410000000000005,
"taskDurationMs": 686.332,
"heapDeltaBytes": -6536624
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1682.2839999999815,
"styleRecalcs": 154,
"styleRecalcDurationMs": 42.963,
"layouts": 16,
"layoutDurationMs": 3.913,
"taskDurationMs": 700.446,
"heapDeltaBytes": -6152700
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1678.4999999999854,
"styleRecalcs": 154,
"styleRecalcDurationMs": 43.014,
"layouts": 16,
"layoutDurationMs": 4.141000000000001,
"taskDurationMs": 695.053,
"heapDeltaBytes": -6460636
}
]
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #9622 to
core/1.41Automatically created by backport workflow.
┆Issue is synchronized with this Notion page by Unito