From 49b5bd70f0d1c0dce46ea85d23deb75dbea6c51c Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Mon, 27 May 2024 12:44:25 +0200 Subject: [PATCH] fix(editor): Send only execution id in postMessage when previewing an execution (#9514) --- packages/editor-ui/src/components/WorkflowPreview.vue | 2 +- .../src/components/__tests__/WorkflowPreview.test.ts | 2 +- packages/editor-ui/src/views/NodeView.vue | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/components/WorkflowPreview.vue b/packages/editor-ui/src/components/WorkflowPreview.vue index 106706262d..3b8c9d5c2f 100644 --- a/packages/editor-ui/src/components/WorkflowPreview.vue +++ b/packages/editor-ui/src/components/WorkflowPreview.vue @@ -119,7 +119,7 @@ const loadExecution = () => { iframeRef.value?.contentWindow?.postMessage?.( JSON.stringify({ command: 'setActiveExecution', - execution: executionsStore.activeExecution, + executionId: executionsStore.activeExecution.id, }), '*', ); diff --git a/packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts b/packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts index c2505912a4..ad91cd3a24 100644 --- a/packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts +++ b/packages/editor-ui/src/components/__tests__/WorkflowPreview.test.ts @@ -179,7 +179,7 @@ describe('WorkflowPreview', () => { expect(postMessageSpy).toHaveBeenCalledWith( JSON.stringify({ command: 'setActiveExecution', - execution: { id: 'abc' }, + executionId: 'abc', }), '*', ); diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 34c74bb1b2..fc56368401 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -4765,7 +4765,9 @@ export default defineComponent({ }); } } else if (json?.command === 'setActiveExecution') { - this.executionsStore.activeExecution = json.execution; + this.executionsStore.activeExecution = (await this.executionsStore.fetchExecution( + json.executionId, + )) as ExecutionSummary; } } catch (e) {} },