fix conditional serialization to drop stale targets for deleted downstream/branch blocks (#4282)
This commit is contained in:
@@ -775,10 +775,7 @@ function serializeConditionalBlock(
|
|||||||
nodes: Array<AppNode>,
|
nodes: Array<AppNode>,
|
||||||
edges: Array<Edge>,
|
edges: Array<Edge>,
|
||||||
): ConditionalBlockYAML {
|
): ConditionalBlockYAML {
|
||||||
const mergeLabel =
|
const mergeLabel = findConditionalMergeLabel(node, nodes, edges) ?? null;
|
||||||
findConditionalMergeLabel(node, nodes, edges) ??
|
|
||||||
node.data.mergeLabel ??
|
|
||||||
null;
|
|
||||||
|
|
||||||
const branchConditions = node.data.branches.map((branch) => {
|
const branchConditions = node.data.branches.map((branch) => {
|
||||||
const orderedNodes = getConditionalBranchNodeSequence(
|
const orderedNodes = getConditionalBranchNodeSequence(
|
||||||
@@ -787,11 +784,7 @@ function serializeConditionalBlock(
|
|||||||
nodes,
|
nodes,
|
||||||
edges,
|
edges,
|
||||||
);
|
);
|
||||||
const nextBlockLabel =
|
const nextBlockLabel = orderedNodes[0]?.data.label ?? mergeLabel ?? null;
|
||||||
orderedNodes[0]?.data.label ??
|
|
||||||
mergeLabel ??
|
|
||||||
branch.next_block_label ??
|
|
||||||
null;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...branch,
|
...branch,
|
||||||
|
|||||||
Reference in New Issue
Block a user