mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Cannot expand sub execution log if it finished with an error (#16236)
Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
@@ -10,6 +10,8 @@ import {
|
||||
type Workflow,
|
||||
type INode,
|
||||
type ISourceData,
|
||||
parseErrorMetadata,
|
||||
type RelatedExecution,
|
||||
} from 'n8n-workflow';
|
||||
import type { LogEntry, LogEntrySelection, LogTreeCreationContext } from './logs.types';
|
||||
import { isProxy, isReactive, isRef, toRaw } from 'vue';
|
||||
@@ -70,13 +72,13 @@ function getChildNodes(
|
||||
runIndex: number | undefined,
|
||||
context: LogTreeCreationContext,
|
||||
) {
|
||||
if (hasSubExecution(treeNode)) {
|
||||
const workflowId = treeNode.runData?.metadata?.subExecution?.workflowId;
|
||||
const executionId = treeNode.runData?.metadata?.subExecution?.executionId;
|
||||
const workflow = workflowId ? context.workflows[workflowId] : undefined;
|
||||
const subWorkflowRunData = executionId ? context.subWorkflowData[executionId] : undefined;
|
||||
const subExecutionLocator = findSubExecutionLocator(treeNode);
|
||||
|
||||
if (!workflow || !subWorkflowRunData || !executionId) {
|
||||
if (subExecutionLocator !== undefined) {
|
||||
const workflow = context.workflows[subExecutionLocator.workflowId];
|
||||
const subWorkflowRunData = context.subWorkflowData[subExecutionLocator.executionId];
|
||||
|
||||
if (!workflow || !subWorkflowRunData) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ function getChildNodes(
|
||||
parent: treeNode,
|
||||
depth: context.depth + 1,
|
||||
workflow,
|
||||
executionId,
|
||||
executionId: subExecutionLocator.executionId,
|
||||
data: subWorkflowRunData,
|
||||
});
|
||||
}
|
||||
@@ -434,7 +436,17 @@ export function mergeStartData(
|
||||
}
|
||||
|
||||
export function hasSubExecution(entry: LogEntry): boolean {
|
||||
return !!entry.runData?.metadata?.subExecution;
|
||||
return findSubExecutionLocator(entry) !== undefined;
|
||||
}
|
||||
|
||||
export function findSubExecutionLocator(entry: LogEntry): RelatedExecution | undefined {
|
||||
const metadata = entry.runData?.metadata?.subExecution;
|
||||
|
||||
if (metadata) {
|
||||
return { workflowId: metadata.workflowId, executionId: metadata.executionId };
|
||||
}
|
||||
|
||||
return parseErrorMetadata(entry.runData?.error)?.subExecution;
|
||||
}
|
||||
|
||||
export function getDefaultCollapsedEntries(entries: LogEntry[]): Record<string, boolean> {
|
||||
|
||||
Reference in New Issue
Block a user