Comfy-Org / Comfy-Org/ComfyUI_frontend
Apply Changes can fail after reconnect because runtime and node definitions are not ready yet
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
When ComfyUI Manager `Apply Changes` triggers a restart, the frontend currently treats websocket reconnect as enough signal to continue the post-restart refresh flow. On slower or proxied deployments, the websocket can reconnect before the HTTP runtime and node definitions are actually ready.
The frontend then immediately refreshes node definitions and reloads the workflow against an instance that is still coming up.
## Current behavior
After the `reconnected` event, the current `Apply Changes` flow immediately:
- marks manager state as stale
- refreshes node definitions
- reloads the current workflow
- considers the restart flow complete shortly afterward
There is no readiness check that:
- the HTTP runtime is reachable again
- `/object_info` can succeed
- manager startup / catalog refresh has actually completed
This can produce failures such as:
- node definition refresh hitting `/object_info` too early and failing
- workflow reload running against stale or incomplete node definitions
- `Apply Changes` looking finished even though the UI still needs a manual reload
## Expected behavior
After reconnect, the frontend should wait until the runtime is actually ready before refreshing node definitions / workflow and before considering `Apply Changes` complete.
At minimum, the flow should only proceed once:
- the HTTP API is reachable again, and
- node definitions can be fetched successfully
If readiness cannot be confirmed in time, the UI should stay in a pending/error state instead of presenting the restart as completed.
## Minimal repro
1. Open the new Manager UI
2. Install or update a node pack and click `Apply Changes`
3. Use an environment where the websocket reconnects before the HTTP runtime is fully ready (reverse proxy / hosted setup / cold start makes this easier to hit)
4. Observe that the frontend proceeds immediately after reconnect, but node definition refresh or workflow reload can fail and the UI may still require a manual browser reload
## Why this matters
A websocket reconnect only tells the frontend that a socket connection was re-established. It is not a reliable signal that the Comfy runtime and node definition endpoint are already ready to serve requests.
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10607-Apply-Changes-can-fail-after-reconnect-because-runtime-and-node-definitions-are-not-r-3306d73d365081b3b749d1924fc5e420) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.