refactor(core): Rename push sessionId to pushRef (#8905)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-04-03 13:43:14 +02:00
committed by GitHub
parent eaaefd76da
commit 072c3db97d
58 changed files with 248 additions and 257 deletions

View File

@@ -91,7 +91,7 @@ export class TestWebhooks implements IWebhookManager {
});
}
const { destinationNode, sessionId, workflowEntity, webhook: testWebhook } = registration;
const { destinationNode, pushRef, workflowEntity, webhook: testWebhook } = registration;
const workflow = this.toWorkflow(workflowEntity);
@@ -112,7 +112,7 @@ export class TestWebhooks implements IWebhookManager {
workflowEntity,
workflowStartNode,
executionMode,
sessionId,
pushRef,
undefined, // IRunExecutionData
undefined, // executionId
request,
@@ -130,11 +130,11 @@ export class TestWebhooks implements IWebhookManager {
if (executionId === undefined) return;
// Inform editor-ui that webhook got received
if (sessionId !== undefined) {
if (pushRef !== undefined) {
this.push.send(
'testWebhookReceived',
{ workflowId: webhook?.workflowId, executionId },
sessionId,
pushRef,
);
}
} catch {}
@@ -147,10 +147,10 @@ export class TestWebhooks implements IWebhookManager {
*/
if (
this.orchestrationService.isMultiMainSetupEnabled &&
sessionId &&
!this.push.getBackend().hasSessionId(sessionId)
pushRef &&
!this.push.getBackend().hasPushRef(pushRef)
) {
const payload = { webhookKey: key, workflowEntity, sessionId };
const payload = { webhookKey: key, workflowEntity, pushRef };
void this.orchestrationService.publish('clear-test-webhooks', payload);
return;
}
@@ -213,7 +213,7 @@ export class TestWebhooks implements IWebhookManager {
workflowEntity: IWorkflowDb,
additionalData: IWorkflowExecuteAdditionalData,
runData?: IRunData,
sessionId?: string,
pushRef?: string,
destinationNode?: string,
) {
if (!workflowEntity.id) throw new WorkflowMissingIdError(workflowEntity);
@@ -260,7 +260,7 @@ export class TestWebhooks implements IWebhookManager {
cacheableWebhook.userId = userId;
const registration: TestWebhookRegistration = {
sessionId,
pushRef,
workflowEntity,
destinationNode,
webhook: cacheableWebhook as IWebhookData,
@@ -302,7 +302,7 @@ export class TestWebhooks implements IWebhookManager {
if (!registration) continue;
const { sessionId, workflowEntity } = registration;
const { pushRef, workflowEntity } = registration;
const workflow = this.toWorkflow(workflowEntity);
@@ -310,9 +310,9 @@ export class TestWebhooks implements IWebhookManager {
this.clearTimeout(key);
if (sessionId !== undefined) {
if (pushRef !== undefined) {
try {
this.push.send('testWebhookDeleted', { workflowId }, sessionId);
this.push.send('testWebhookDeleted', { workflowId }, pushRef);
} catch {
// Could not inform editor, probably is not connected anymore. So simply go on.
}