Commit 916e085
fix: RAF-batch WebSocket progress events (#9303)
## What
RAF-batch WebSocket `progress` and `progress_state` events to coalesce
multiple updates per animation frame.
## Why
Each WebSocket progress message immediately updates reactive state,
triggering Vue re-renders. Profiler shows 339 markers from
`onProgressUpdate`. During rapid execution, multiple progress events per
frame cause redundant reactive update → watcher → setDirty cycles.
## How
Defer reactive state updates to `requestAnimationFrame` callbacks.
Multiple progress events within the same frame are coalesced — only the
latest value is applied. Pending RAFs are cancelled on
`unbindExecutionEvents`.
## Verification
- [x] Unit tests verifying RAF batching behavior (7 new tests)
- [x] `pnpm typecheck` passes
- [x] `pnpm lint` passes
## Perf Impact
Reduces per-frame reactive updates during workflow execution from N (one
per WebSocket message) to 1.
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9303-fix-RAF-batch-WebSocket-progress-events-3156d73d365081959d93e85a4b8d38c4)
by [Unito](https://www.unito.io)
---------
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Connor Byrne <c.byrne@comfy.org>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a4342bb commit 916e085
4 files changed
Lines changed: 550 additions & 9 deletions
0 commit comments