Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Don't change upload id on resumed uploads (#175)

Hakan Shehue117770e20a1
diff --git a/apps/server/src/api/client/routes/workspaces/files/file-upload-tus.ts b/apps/server/src/api/client/routes/workspaces/files/file-upload-tus.ts
index c8bde00d..a0632401 100644
--- a/apps/server/src/api/client/routes/workspaces/files/file-upload-tus.ts
+++ b/apps/server/src/api/client/routes/workspaces/files/file-upload-tus.ts
@@ -179,14 +179,12 @@ export const fileUploadTusRoute: FastifyPluginCallbackZod = (
}
}
- // create the upload record
- const uploadId = generateId(IdType.Upload);
const createdUpload = await database
.insertInto('uploads')
.returningAll()
.values({
file_id: fileId,
- upload_id: uploadId,
+ upload_id: generateId(IdType.Upload),
workspace_id: workspaceId,
root_id: file.rootId,
mime_type: file.attributes.mimeType,
@@ -198,9 +196,6 @@ export const fileUploadTusRoute: FastifyPluginCallbackZod = (
})
.onConflict((oc) =>
oc.columns(['file_id']).doUpdateSet({
- upload_id: uploadId,
- created_at: new Date(),
- created_by: request.user.id,
mime_type: file.attributes.mimeType,
size: file.attributes.size,
path: path,