fix(core): Fix missing execution ID in webhook-based workflow producing binary data (#7244)

Story: https://linear.app/n8n/issue/PAY-839

This is a longstanding bug, fixed now so that the S3 backend for binary
data can use execution IDs as part of the filename.

To reproduce:

1. Set up a workflow with a POST Webhook node that accepts binary data.
2. Activate the workflow and call it sending a binary file, e.g. `curl
-X POST -F "file=@/path/to/binary/file/test.jpg"
http://localhost:5678/webhook/uuid`
3. Check `~/.n8n/binaryData`. The binary data and metadata files will be
missing the execution ID, e.g. `11869055-83c4-4493-876a-9092c4708b9b`
instead of `39011869055-83c4-4493-876a-9092c4708b9b`.
This commit is contained in:
Iván Ovejero
2023-09-25 12:30:28 +02:00
committed by GitHub
parent dcc9cc13ed
commit 33991e92d0
6 changed files with 156 additions and 0 deletions

View File

@@ -154,6 +154,14 @@ export class BinaryDataService {
return inputData as INodeExecutionData[][];
}
async rename(oldFileId: string, newFileId: string) {
const manager = this.getManager(this.mode);
if (!manager) return;
await manager.rename(oldFileId, newFileId);
}
// ----------------------------------
// private methods
// ----------------------------------