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; };