Skip to content

Commit 4bbece2

Browse files
committed
improvement(files): keep the lazy entry stream in byte mode
Readable.from defaults to object mode; these chunks are bytes headed for an archive, so the mode is now explicit. Also makes the fire-and-forget bulk download call consistent with its sibling.
1 parent 8d567de commit 4bbece2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

  • apps/sim/app

apps/sim/app/api/workspaces/[id]/files/download/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ function lazyWorkspaceFileStream(file: WorkspaceFileRecord): Readable {
7272
key: file.key,
7373
context: file.storageContext ?? 'workspace',
7474
})
75-
})()
75+
})(),
76+
// `Readable.from` defaults to object mode; these are bytes headed for an archive.
77+
{ objectMode: false }
7678
)
7779
}
7880

apps/sim/app/workspace/[workspaceId]/files/files.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ export function Files() {
12891289
if (!item) return
12901290
const rowId = item.kind === 'file' ? fileRowId(item.file.id) : folderRowId(item.folder.id)
12911291
if (selectedRowIds.has(rowId) && selectedRowIds.size > 1) {
1292-
handleBulkDownload()
1292+
void handleBulkDownload()
12931293
closeContextMenu()
12941294
return
12951295
}

0 commit comments

Comments
 (0)