fix(core): Prevent multiple values in the execution metadata for the same key and executionId (#9953)

This commit is contained in:
Danny Martini
2024-07-10 12:47:43 +02:00
committed by GitHub
parent 3a179439c7
commit 2e6b03b2cb
9 changed files with 203 additions and 15 deletions

View File

@@ -15,20 +15,26 @@ describe('ExecutionMetadataService', () => {
await Container.get(ExecutionMetadataService).save(executionId, toSave);
expect(repository.save).toHaveBeenCalledTimes(1);
expect(repository.save.mock.calls[0]).toEqual([
expect(repository.upsert).toHaveBeenCalledTimes(1);
expect(repository.upsert.mock.calls[0]).toEqual([
[
{
execution: { id: executionId },
executionId,
key: 'test1',
value: 'value1',
},
{
execution: { id: executionId },
executionId,
key: 'test2',
value: 'value2',
},
],
{
conflictPaths: {
executionId: true,
key: true,
},
},
]);
});
});