fix: ensure multipart part sizeBytes are Numbers, not DB strings

This commit is contained in:
asepharyana
2026-07-07 04:42:07 +07:00
parent 2e447ee58a
commit 339f788dc9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ export const listMultipartParts = async (uploadId: string): Promise<MultipartPar
telegramFileId: r.telegram_file_id as string,
telegramFileUniqueId: r.telegram_file_unique_id as string,
storageMessageId: r.storage_message_id as number,
sizeBytes: r.size_bytes as number,
sizeBytes: Number(r.size_bytes),
etag: r.etag as string,
createdAt: new Date(r.created_at as string),
}));
+1 -1
View File
@@ -393,7 +393,7 @@ const handleGetMultipartObject = async (
);
}
const totalSize = parts.reduce((sum, p) => sum + p.sizeBytes, 0);
const totalSize = parts.reduce((sum, p) => sum + Number(p.sizeBytes), 0);
const range = parseRangeHeader(headers.range || null, totalSize);
if (range.type === 'invalid') {
return s3ErrorResponse(