mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 06:35:10 +00:00
CodeRabbit raised two valid concerns: 1. If processSelect throws (e.g. through a node/extension callback), the plain assign-and-restore pattern leaves onSelectionChange unset and silently drops every later selection change on this canvas. 2. The unconditional RAF schedules a pointless store sync on the already-selected sticky-resselect path where processSelect early-returns without notifying. Both fixes are the same shape: replace the temporary undefined with a sentinel that records whether processSelect actually attempted a notification, wrap processSelect in try/finally so the original listener is always restored, then schedule the RAF only if the sentinel fired. Adds two tests covering each guarantee.