Comfy-Org / Comfy-Org/ComfyUI_frontend

Bug: removeWidgetByName calls demote but promotionStore still holds entry

Open
#10,174 1 comment 0 reactions 0 assignees View on GitHub
area:subgraph area:widgets
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Description

`SubgraphNode.removeWidgetByName` calls `demote()` but the `widgets` getter rebuilds from `promotionStore`, which still holds the entry. This means the widget reappears after removal.

## Reproduction

1. Promote a widget onto a subgraph node
2. Call `removeWidgetByName` on the promoted widget
3. Access `subgraphNode.widgets` — the removed widget is still present

## Expected Behavior

After `removeWidgetByName`, the widget should be fully removed from both the node and the promotion store.

## Context

Discovered during test hardening in #9967. The skipped test `should fire widget-demoted event when removing promoted widget` in `SubgraphWidgetPromotion.test.ts` documents this behavior.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10174-Bug-removeWidgetByName-calls-demote-but-promotionStore-still-holds-entry-3266d73d365081d8a7c1f76c695e2942) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.