Skip to content

Commit cd5d1c0

Browse files
authored
fix(executor): nested error activation (#2184)
1 parent 9df87d9 commit cd5d1c0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/sim/executor/execution/edge-manager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class EdgeManager {
1717
skipBackwardsEdge = false
1818
): string[] {
1919
const readyNodes: string[] = []
20+
const activatedTargets: string[] = []
2021

2122
for (const [edgeId, edge] of node.outgoingEdges) {
2223
if (skipBackwardsEdge && this.isBackwardsEdge(edge.sourceHandle)) {
@@ -44,9 +45,14 @@ export class EdgeManager {
4445
}
4546

4647
targetNode.incomingEdges.delete(node.id)
48+
activatedTargets.push(edge.target)
49+
}
4750

48-
if (this.isNodeReady(targetNode)) {
49-
readyNodes.push(targetNode.id)
51+
// Check readiness after all edges processed to ensure cascade deactivations are complete
52+
for (const targetId of activatedTargets) {
53+
const targetNode = this.dag.nodes.get(targetId)
54+
if (targetNode && this.isNodeReady(targetNode)) {
55+
readyNodes.push(targetId)
5056
}
5157
}
5258

0 commit comments

Comments
 (0)