Comfy-Org / Comfy-Org/ComfyUI_frontend

Dedupe useErrorClassification across consumers with createSharedComposable

Open Beginner friendly
#15,120 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Problem

`useErrorClassification()` builds an independent `computed` per caller, so simultaneously mounted consumers (RightSidePanel via `useHasBlockingError`, ErrorGroupList via `useErrorGroups`, the error overlay state) each re-run `classifyPanelErrors` — the full absorption matching over nodeErrors × missingModels × missingMedia — on every store change. Pure inputs mean no drift, only duplicated work, but the composable name implies shared derived state while delivering per-caller instances.

## Suggested fix

Wrap with `createSharedComposable` from `@vueuse/core` so the computed is deduped across consumers and disposed when the last one unmounts. One-line change plus a test that two consumers observe the same instance.

Found during the multi-agent review of #14440.

Contributor guide

Open the contributing guide

Research direction

Start by locating the useErrorClassification composable and its existing tests, then inspect how useHasBlockingError, useErrorGroups, and the error overlay consume it. Wrap the composable with createSharedComposable and add a test showing two consumers observe the same instance; done means the shared state is deduplicated and is disposed after the last consumer unmounts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.