mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-27 14:57:21 +02:00
fix(core): Ensure execution recovery skips successful executions (#9793)
This commit is contained in:
parent
e3e20b48eb
commit
4131408e5e
|
|
@ -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: {} } };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user