Skip to content

Commit 91c0772

Browse files
committed
fix(uploads): address PR review — typo, complete-failure cleanup, double-increment
1 parent 7ab4465 commit 91c0772

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/sim/lib/uploads/client/direct-upload.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ const uploadViaMultipart = async (
455455
})
456456

457457
if (!completeResponse.ok) {
458+
await abortMultipart()
458459
throw new DirectUploadError(
459460
`Failed to complete multipart upload: ${completeResponse.statusText}`,
460461
'MULTIPART_ERROR'

apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ export async function registerUploadedWorkspaceFile(params: {
349349
await cleanupOrphan('metadata insert failure')
350350
throw insertError
351351
}
352-
}
353352

354-
try {
355-
await incrementStorageUsage(userId, verifiedSize)
356-
} catch (storageError) {
357-
logger.error('Failed to update storage tracking:', storageError)
353+
try {
354+
await incrementStorageUsage(userId, verifiedSize)
355+
} catch (storageError) {
356+
logger.error('Failed to update storage tracking:', storageError)
357+
}
358358
}
359359

360360
const pathPrefix = getServePathPrefix()

apps/sim/lib/uploads/utils/file-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export function isNetworkError(error: unknown): boolean {
320320
message.includes('connection') ||
321321
message.includes('timeout') ||
322322
message.includes('timed out') ||
323-
message.includes('ecconnreset')
323+
message.includes('econnreset')
324324
)
325325
}
326326

0 commit comments

Comments
 (0)