From c66a7bd335999ec824446d081aaf891ad5bf8f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 6 Dec 2024 11:19:49 +0100 Subject: [PATCH] WAIT_TIME_UNLIMITED -> WAIT_INDEFINITELY --- .../__tests__/shared-tests.ts | 4 ++-- .../base-execute-context.ts | 9 ++------- packages/editor-ui/src/components/Node.vue | 10 +++++++--- .../global/GlobalExecutionsListItem.vue | 4 ++-- .../src/composables/useCanvasMapping.ts | 17 ++++++++--------- packages/editor-ui/src/constants.ts | 1 - packages/nodes-base/nodes/Form/Form.node.ts | 5 ++--- .../nodes/Google/Gmail/v2/GmailV2.node.ts | 4 ++-- .../nodes-base/nodes/Slack/V2/SlackV2.node.ts | 4 ++-- packages/nodes-base/nodes/Wait/Wait.node.ts | 4 ++-- packages/workflow/src/Constants.ts | 2 +- 11 files changed, 30 insertions(+), 34 deletions(-) diff --git a/packages/core/src/node-execution-context/__tests__/shared-tests.ts b/packages/core/src/node-execution-context/__tests__/shared-tests.ts index 72a53a0d9f..9992507bdd 100644 --- a/packages/core/src/node-execution-context/__tests__/shared-tests.ts +++ b/packages/core/src/node-execution-context/__tests__/shared-tests.ts @@ -14,7 +14,7 @@ import type { RelatedExecution, IExecuteWorkflowInfo, } from 'n8n-workflow'; -import { ApplicationError, NodeHelpers, WAIT_TIME_UNLIMITED } from 'n8n-workflow'; +import { ApplicationError, NodeHelpers, WAIT_INDEFINITELY } from 'n8n-workflow'; import Container from 'typedi'; import { BinaryDataService } from '@/BinaryData/BinaryData.service'; @@ -235,7 +235,7 @@ export const describeCommonTests = ( }); expect(additionalData.setExecutionStatus).toHaveBeenCalledWith('waiting'); - expect(runExecutionData.waitTill).toEqual(new Date(WAIT_TIME_UNLIMITED)); + expect(runExecutionData.waitTill).toEqual(WAIT_INDEFINITELY); expect(result.waitTill).toBe(waitTill); }); }); diff --git a/packages/core/src/node-execution-context/base-execute-context.ts b/packages/core/src/node-execution-context/base-execute-context.ts index eed2d29684..0794a263b0 100644 --- a/packages/core/src/node-execution-context/base-execute-context.ts +++ b/packages/core/src/node-execution-context/base-execute-context.ts @@ -22,12 +22,7 @@ import type { ISourceData, AiEvent, } from 'n8n-workflow'; -import { - ApplicationError, - NodeHelpers, - WAIT_TIME_UNLIMITED, - WorkflowDataProxy, -} from 'n8n-workflow'; +import { ApplicationError, NodeHelpers, WAIT_INDEFINITELY, WorkflowDataProxy } from 'n8n-workflow'; import { Container } from 'typedi'; import { BinaryDataService } from '@/BinaryData/BinaryData.service'; @@ -131,7 +126,7 @@ export class BaseExecuteContext extends NodeExecutionContext { if (result.waitTill) { // then put the parent workflow execution also into the waiting state, // but do not use the sub-workflow `waitTill` to avoid WaitTracker resuming the parent execution at the same time as the sub-workflow - await this.putExecutionToWait(new Date(WAIT_TIME_UNLIMITED)); + await this.putExecutionToWait(WAIT_INDEFINITELY); } const data = await this.binaryDataService.duplicateBinaryData( diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 1f1ea90ab5..f20724bd5f 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -9,7 +9,6 @@ import { SIMULATE_NODE_TYPE, SIMULATE_TRIGGER_NODE_TYPE, WAIT_NODE_TYPE, - WAIT_TIME_UNLIMITED, } from '@/constants'; import type { ExecutionSummary, @@ -18,7 +17,12 @@ import type { NodeOperationError, Workflow, } from 'n8n-workflow'; -import { NodeConnectionType, NodeHelpers, SEND_AND_WAIT_OPERATION } from 'n8n-workflow'; +import { + NodeConnectionType, + NodeHelpers, + SEND_AND_WAIT_OPERATION, + WAIT_INDEFINITELY, +} from 'n8n-workflow'; import type { StyleValue } from 'vue'; import { computed, onMounted, ref, watch } from 'vue'; import xss from 'xss'; @@ -345,7 +349,7 @@ const waiting = computed(() => { return i18n.baseText('node.theNodeIsWaitingFormCall'); } const waitDate = new Date(workflowExecution.waitTill); - if (waitDate.toISOString() === WAIT_TIME_UNLIMITED) { + if (waitDate.getTime() === WAIT_INDEFINITELY.getTime()) { return i18n.baseText('node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall'); } return i18n.baseText('node.nodeIsWaitingTill', { diff --git a/packages/editor-ui/src/components/executions/global/GlobalExecutionsListItem.vue b/packages/editor-ui/src/components/executions/global/GlobalExecutionsListItem.vue index 1fbbfd542a..d179476531 100644 --- a/packages/editor-ui/src/components/executions/global/GlobalExecutionsListItem.vue +++ b/packages/editor-ui/src/components/executions/global/GlobalExecutionsListItem.vue @@ -1,8 +1,8 @@