Comfy-Org / Comfy-Org/ComfyUI_frontend
Bug: removeWidgetByName calls demote but promotionStore still holds entry
- 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
Assessment
This issue has not been assessed yet.