fix conditional serialization to drop stale targets for deleted downstream/branch blocks (#4282)

This commit is contained in:
Celal Zamanoglu
2025-12-12 17:40:16 +03:00
committed by GitHub
parent 41c16d513a
commit 401af044b4

View File

@@ -775,10 +775,7 @@ function serializeConditionalBlock(
nodes: Array<AppNode>,
edges: Array<Edge>,
): ConditionalBlockYAML {
const mergeLabel =
findConditionalMergeLabel(node, nodes, edges) ??
node.data.mergeLabel ??
null;
const mergeLabel = findConditionalMergeLabel(node, nodes, edges) ?? null;
const branchConditions = node.data.branches.map((branch) => {
const orderedNodes = getConditionalBranchNodeSequence(
@@ -787,11 +784,7 @@ function serializeConditionalBlock(
nodes,
edges,
);
const nextBlockLabel =
orderedNodes[0]?.data.label ??
mergeLabel ??
branch.next_block_label ??
null;
const nextBlockLabel = orderedNodes[0]?.data.label ?? mergeLabel ?? null;
return {
...branch,