diff --git a/src/utils/graphTraversalUtil.test.ts b/src/utils/graphTraversalUtil.test.ts index 1b477aea743..e7b18acde17 100644 --- a/src/utils/graphTraversalUtil.test.ts +++ b/src/utils/graphTraversalUtil.test.ts @@ -1566,6 +1566,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 7341965901f..556a04cc690 100644 --- a/src/utils/graphTraversalUtil.ts +++ b/src/utils/graphTraversalUtil.ts @@ -934,7 +934,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) }