mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
🐛 Fix bug that not all Trigger-Nodes got updated/removed
This commit is contained in:
parent
83c49ddd21
commit
8b1fe83cc0
|
@ -75,17 +75,21 @@ export class ActiveWorkflows {
|
||||||
const triggerNodes = workflow.getTriggerNodes();
|
const triggerNodes = workflow.getTriggerNodes();
|
||||||
|
|
||||||
let triggerResponse: ITriggerResponse | undefined;
|
let triggerResponse: ITriggerResponse | undefined;
|
||||||
|
this.workflowData[id].triggerResponses = [];
|
||||||
for (const triggerNode of triggerNodes) {
|
for (const triggerNode of triggerNodes) {
|
||||||
triggerResponse = await workflow.runTrigger(triggerNode, getTriggerFunctions, additionalData, 'trigger');
|
triggerResponse = await workflow.runTrigger(triggerNode, getTriggerFunctions, additionalData, 'trigger');
|
||||||
if (triggerResponse !== undefined) {
|
if (triggerResponse !== undefined) {
|
||||||
// If a response was given save it
|
// If a response was given save it
|
||||||
this.workflowData[id].triggerResponse = triggerResponse;
|
this.workflowData[id].triggerResponses!.push(triggerResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pollNodes = workflow.getPollNodes();
|
const pollNodes = workflow.getPollNodes();
|
||||||
for (const pollNode of pollNodes) {
|
if (pollNodes.length) {
|
||||||
this.workflowData[id].pollResponse = await this.activatePolling(pollNode, workflow, additionalData, getPollFunctions);
|
this.workflowData[id].pollResponses = [];
|
||||||
|
for (const pollNode of pollNodes) {
|
||||||
|
this.workflowData[id].pollResponses!.push(await this.activatePolling(pollNode, workflow, additionalData, getPollFunctions));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,12 +216,20 @@ export class ActiveWorkflows {
|
||||||
|
|
||||||
const workflowData = this.workflowData[id];
|
const workflowData = this.workflowData[id];
|
||||||
|
|
||||||
if (workflowData.triggerResponse && workflowData.triggerResponse.closeFunction) {
|
if (workflowData.triggerResponses) {
|
||||||
await workflowData.triggerResponse.closeFunction();
|
for (const triggerResponse of workflowData.triggerResponses) {
|
||||||
|
if (triggerResponse.closeFunction) {
|
||||||
|
await triggerResponse.closeFunction();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workflowData.pollResponse && workflowData.pollResponse.closeFunction) {
|
if (workflowData.pollResponses) {
|
||||||
await workflowData.pollResponse.closeFunction();
|
for (const pollResponse of workflowData.pollResponses) {
|
||||||
|
if (pollResponse.closeFunction) {
|
||||||
|
await pollResponse.closeFunction();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete this.workflowData[id];
|
delete this.workflowData[id];
|
||||||
|
|
|
@ -123,7 +123,7 @@ export interface INodeInputDataConnections {
|
||||||
|
|
||||||
|
|
||||||
export interface IWorkflowData {
|
export interface IWorkflowData {
|
||||||
pollResponse?: IPollResponse;
|
pollResponses?: IPollResponse[];
|
||||||
triggerResponse?: ITriggerResponse;
|
triggerResponses?: ITriggerResponse[];
|
||||||
workflow: Workflow;
|
workflow: Workflow;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue