Comfy-Org / Comfy-Org/ComfyUI_frontend
Follow-up: Consolidate all local isAbortError implementations to use the canonical helper in typeGuardUtil.ts
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Context
Identified as a follow-up during review of PR #11873.
## Problem
The canonical `isAbortError` helper lives in `src/utils/typeGuardUtil.ts` (`err instanceof DOMException && err.name === 'AbortError'`) and is already used by `releaseService`, `customerEventsService`, `comfyRegistryService`, and `comfyManagerService`.
PR #11873 added two more local copies in `missingMediaScan.ts` and `missingModelScan.ts`. Additionally, `missingModelStore.ts` has a fourth copy with a weaker check (`error instanceof Error` instead of `instanceof DOMException`). Because `fetch()` cancellation throws `DOMException`, in environments where `DOMException` does not extend `Error`, the `missingModelStore` version returns `false` for real fetch aborts and the error falls through to non-abort handling — a correctness issue.
## Proposed Work
- Remove the local `isAbortError` copies from `missingMediaScan.ts`, `missingModelScan.ts`, and `missingModelStore.ts`.
- Replace all four with an import from `src/utils/typeGuardUtil.ts`.
- Fix the weaker `missingModelStore` version (`instanceof Error`) to use the DOMException-based canonical form.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11873
- Requested by: @jaeone94
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11895-Follow-up-Consolidate-all-local-isAbortError-implementations-to-use-the-canonical-he-3566d73d365081c78136f4a91f28af8b) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.