Comfy-Org / Comfy-Org/ComfyUI_frontend
Cancel timed-out 3D model thumbnail loads
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Add cancellation support for timed-out 3D model thumbnail loads.
`src/components/load3d/modelThumbnail.ts` times out `load3d.loadModel(modelUrl)`, but `load3d.remove()` does not cancel the in-flight load. The request and decode work can continue after the thumbnail renderer is disposed.
## Required changes
- Add `AbortSignal` support through the 3D loading path.
- Propagate the signal from the thumbnail model-loading flow through `Load3d`, `LoaderManager`, and `fetchModelData()`.
- Abort the active load when the thumbnail timeout occurs.
- Abort the active load before viewport disposal when thumbnail cleanup occurs.
- Ensure an aborted load cannot call `setupModel()` after disposal.
- Preserve serialized thumbnail generation and existing successful-load behavior.
## Affected areas
- `src/components/load3d/modelThumbnail.ts`
- `src/extensions/core/load3d/Load3d.ts`
- `src/extensions/core/load3d/LoaderManager.ts`
- The module that defines `fetchModelData()`
- Relevant 3D loading and thumbnail tests
## Rationale
The current timeout returns control to the thumbnail queue, but it does not stop network, parsing, or model setup work. Cancellation prevents stale work from mutating a disposed viewport and reduces resource use.
## Acceptance criteria
- A timed-out thumbnail load aborts its underlying request.
- Disposal aborts an unfinished thumbnail load.
- An aborted load does not invoke `setupModel()` after disposal.
- Later queued thumbnail generations can complete normally.
- Regression tests cover timeout cancellation, disposal cancellation, and queue recovery.
## Backlinks
- Follow-up requested by @christian-byrne.
- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16385
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/16385#discussion_r3900431219
Contributor guide
Assessment
This issue has not been assessed yet.