diff --git a/src/utils/graphTraversalUtil.test.ts b/src/utils/graphTraversalUtil.test.ts index dbe5cf2f7e4..cc64619d01e 100644 --- a/src/utils/graphTraversalUtil.test.ts +++ b/src/utils/graphTraversalUtil.test.ts @@ -1539,6 +1539,15 @@ describe('graphTraversalUtil', () => { expect(executionIds).toEqual(['789', '456', '123']) // DFS processes in LIFO order }) + it('should keep a colon-bearing root node ID whole', () => { + const graph = createMockGraph([]) + const node = createMockNode('insert:op-123:root:node:29', { graph }) + + const executionIds = getExecutionIdsForSelectedNodes([node]) + + expect(executionIds).toEqual(['insert:op-123:root:node:29']) + }) + it('should expand subgraph nodes to include all children', () => { const graph = createMockGraph([]) const subNodes = [createMockNode('10'), createMockNode('11')] diff --git a/src/utils/graphTraversalUtil.ts b/src/utils/graphTraversalUtil.ts index 3fecacb2022..bb12db8b37d 100644 --- a/src/utils/graphTraversalUtil.ts +++ b/src/utils/graphTraversalUtil.ts @@ -948,7 +948,7 @@ export function getExecutionIdsForSelectedNodes( node: LGraphNode, parentExecutionId: string | null ): NodeExecutionId | null { - if (!parentExecutionId) return createNodeExecutionId([node.id]) + if (!parentExecutionId) return createLeafNodeExecutionId(node.id) return createExecutionIdFromPath(parentExecutionId, node.id) }