fix(ui): stabilize workflow node execution state updates#9029
fix(ui): stabilize workflow node execution state updates#9029JPPhoto wants to merge 3 commits intoinvoke-ai:mainfrom
Conversation
23fae17 to
894df8a
Compare
057032b to
780663a
Compare
36894df to
f2068cf
Compare
There was a problem hiding this comment.
It's a funny coincidence that I noticed the doubled output just a few days ago on my own, and was puzzled by it, not knowing whether it was a feature or a bug.
In any case, I'm having difficulty testing this PR. I set up the very simple integer operation workflow shown below. When I run it, the nodes go into permanent pending state and continue showing pending even after cancelling. On the other hand, when using an image generation workflow that previously doubled the output, the doubled output is gone. However, the nodes at the very beginning and end of the workflow get stuck in PENDING. Is there something I'm doing wrong?
(Yes, I rebuilt the front end)
I think there are multiple issues here and this PR addresses double results while #9043 addresses status issues. Can you locally merge #9043 into your checkout and see if everything is better with both applied? |
e0b1e7d to
4afe259
Compare
Will do. I'm traveling for a bunch of business meetings this week so it may be a couple days before I get back to this, but I'm anxious to get it pushed through. |
|
I've created a branch that contains both #9029 and #9043 . However the problem of stuck workflows persists. When I create the simplest workflow of them all, a single Add Integers node, and press the invoke button, about 90% of the time it gets stuck in pending state. If I create a slightly more complex workflow, such as feeding the Add Integers output into Integer Range of Size, the workflow completes about 80% of the time and get stuck in PENDING the rest of the time. This suggests to me that there is still a race condition of some sort. Let me know if testing this the wrong way. |
4afe259 to
e65a67f
Compare
|
I think I have the issue isolated. The node's initial execution state has not been put into |
…tialization is processed correctly
0af9f1f to
46cc494
Compare
Summary
Fixes workflow node execution state updates in the frontend event layer.
This change fixes nodes getting stuck in
IN_PROGRESSor showing duplicate outputs when socket events arrive out of order or are repeated. The fix moves the event-ordering logic into shared helpers and uses a listener-local completed-invocation key set so lateinvocation_started/invocation_progressevents cannot overwrite a completed node state.Related Issues / Discussions
QA Instructions
main, run a workflow in the Workflow Editor and examine the Outputs pane for a node that executes. You should see two outputs even when the node is executed once.pnpm vitest runto run regression tests.Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)