From c0021bbe7c359f8b5af3a33557416e966afd3916 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Fri, 18 Oct 2024 22:48:23 +0700 Subject: [PATCH] qfix: pass file uuid to uppy metadata (#6985) Signed-off-by: Alexander Onnikov --- plugins/uploader-resources/src/uppy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/uploader-resources/src/uppy.ts b/plugins/uploader-resources/src/uppy.ts index fe31aa2733..ce175d3a40 100644 --- a/plugins/uploader-resources/src/uppy.ts +++ b/plugins/uploader-resources/src/uppy.ts @@ -128,8 +128,11 @@ export function getUppy (options: FileUploadOptions): Uppy { uppy.addPreProcessor(async (fileIds: string[]) => { for (const fileId of fileIds) { const file = uppy.getFile(fileId) - if (file != null && file.meta.uuid === undefined) { - uppy.setFileMeta(fileId, { uuid: generateFileId() }) + if (file != null) { + // It may seem weird that we modify file name here + // but we need a way to pass file UUID to Datalake via form data + const uuid = file.meta.uuid ?? generateFileId() + uppy.setFileMeta(fileId, { uuid, name: uuid }) } } })