From cb653b2b7068551777f566d5c8aa680ed7aeb51b Mon Sep 17 00:00:00 2001 From: James Date: Tue, 7 Feb 2023 13:34:28 -0500 Subject: [PATCH] fix: checkForDynamicExecutions --- packages/console/src/components/common/utils.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/console/src/components/common/utils.ts b/packages/console/src/components/common/utils.ts index 5c7712552..3cff6d5b3 100644 --- a/packages/console/src/components/common/utils.ts +++ b/packages/console/src/components/common/utils.ts @@ -27,13 +27,15 @@ export function measureText(fontDefinition: string, text: string) { */ export const checkForDynamicExecutions = (allExecutions, staticExecutions) => { const parentsToFetch = {}; + const executionsByNodeId = {}; for (const executionId in allExecutions) { + const execution = allExecutions[executionId]; + executionsByNodeId[execution.id.nodeId] = execution; if (!staticExecutions[executionId]) { - const dynamicExecution = allExecutions[executionId]; - if (dynamicExecution) { + if (execution) { const dynamicExecutionId = - dynamicExecution.metadata?.specNodeId || dynamicExecution.id; - const uniqueParentId = dynamicExecution.fromUniqueParentId; + execution.metadata?.specNodeId || execution.id; + const uniqueParentId = execution.fromUniqueParentId; if (uniqueParentId) { if (parentsToFetch[uniqueParentId]) { parentsToFetch[uniqueParentId].push(dynamicExecutionId); @@ -46,7 +48,8 @@ export const checkForDynamicExecutions = (allExecutions, staticExecutions) => { } const result = {}; for (const parentId in parentsToFetch) { - result[parentId] = allExecutions[parentId]; + const execution = executionsByNodeId[parentId]; + result[execution.scopedId] = execution; } return result; };