mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-27 22:20:53 +00:00
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', () => {
|
||||
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
|
||||
|
||||
@@ -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: {} } };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user