fix(core): Ensure execution recovery skips successful executions (#9793)

This commit is contained in:
Iván Ovejero
2024-06-19 09:45:50 +02:00
committed by GitHub
parent e3e20b48eb
commit 4131408e5e
2 changed files with 23 additions and 1 deletions

View File

@@ -347,6 +347,28 @@ describe('ExecutionRecoveryService', () => {
});
describe('if leader, with 1+ messages', () => {
test('should return `null` if execution succeeded', async () => {
/**
* Arrange
*/
const workflow = await createWorkflow();
const execution = await createExecution({ status: 'success' }, workflow);
const messages = setupMessages(execution.id, 'Some workflow');
/**
* Act
*/
const amendedExecution = await executionRecoveryService.recoverFromLogs(
execution.id,
messages,
);
/**
* Assert
*/
expect(amendedExecution).toBeNull();
});
test('should return `null` if no execution found', async () => {
/**
* Arrange

View File

@@ -175,7 +175,7 @@ export class ExecutionRecoveryService {
unflattenData: true,
});
if (!execution) return null;
if (!execution || execution.status === 'success') return null;
const runExecutionData = execution.data ?? { resultData: { runData: {} } };