fix(core): Don't send a executionFinished event to the browser with no run data if the execution has already been cleaned up (#11502)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Danny Martini
2024-11-04 13:04:22 +01:00
committed by GitHub
parent da18e1ad29
commit d1153f51e8
3 changed files with 33 additions and 8 deletions

View File

@@ -35,6 +35,7 @@ import * as WorkflowHelpers from '@/workflow-helpers';
import { generateFailedExecutionFromError } from '@/workflow-helpers';
import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service';
import { ExecutionNotFoundError } from './errors/execution-not-found-error';
import { EventService } from './events/event.service';
@Service()
@@ -57,12 +58,21 @@ export class WorkflowRunner {
/** The process did error */
async processError(
error: ExecutionError,
error: ExecutionError | ExecutionNotFoundError,
startedAt: Date,
executionMode: WorkflowExecuteMode,
executionId: string,
hooks?: WorkflowHooks,
) {
// This means the execution was probably cancelled and has already
// been cleaned up.
//
// FIXME: This is a quick fix. The proper fix would be to not remove
// the execution from the active executions while it's still running.
if (error instanceof ExecutionNotFoundError) {
return;
}
ErrorReporter.error(error, { executionId });
const isQueueMode = config.getEnv('executions.mode') === 'queue';