fix(core): Ensure execution recovery skips successful executions (#9793)
This commit is contained in:
@@ -347,6 +347,28 @@ describe('ExecutionRecoveryService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('if leader, with 1+ messages', () => {
|
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 () => {
|
test('should return `null` if no execution found', async () => {
|
||||||
/**
|
/**
|
||||||
* Arrange
|
* Arrange
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ export class ExecutionRecoveryService {
|
|||||||
unflattenData: true,
|
unflattenData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!execution) return null;
|
if (!execution || execution.status === 'success') return null;
|
||||||
|
|
||||||
const runExecutionData = execution.data ?? { resultData: { runData: {} } };
|
const runExecutionData = execution.data ?? { resultData: { runData: {} } };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user