fix(core): Fix test runs of triggers that rely on static data (#8524)

This commit is contained in:
Iván Ovejero
2024-02-01 18:05:23 +01:00
committed by GitHub
parent 934d0d35b1
commit 528c07134a
2 changed files with 12 additions and 9 deletions

View File

@@ -91,10 +91,12 @@ export class TestWebhooks implements IWebhookManager {
});
}
const { destinationNode, sessionId, workflowEntity } = registration;
const { destinationNode, sessionId, workflowEntity, webhook: testWebhook } = registration;
const workflow = this.toWorkflow(workflowEntity);
if (testWebhook.staticData) workflow.setTestStaticData(testWebhook.staticData);
const workflowStartNode = workflow.getNode(webhook.node);
if (workflowStartNode === null) {
@@ -405,14 +407,7 @@ export class TestWebhooks implements IWebhookManager {
connections: workflowEntity.connections,
active: false,
nodeTypes: this.nodeTypes,
/**
* `staticData` in the original workflow entity has production webhook IDs.
* Since we are creating here a temporary workflow only for a test webhook,
* `staticData` from the original workflow entity should not be transferred.
*/
staticData: undefined,
staticData: {},
settings: workflowEntity.settings,
});
}