feat(upload): increase upload limit and fix folder upload placeholders

This commit is contained in:
yiling
2026-06-07 15:53:51 +08:00
parent 62a2cb3589
commit 78de8e463d
2 changed files with 30 additions and 17 deletions
+3
View File
@@ -44,6 +44,9 @@ if (process.env.WORKFLOW_EXECUTOR === 'temporal') {
const server = Bun.serve({
port: 3000,
fetch: app.fetch,
maxRequestBodySize: process.env.MAX_REQUEST_BODY_SIZE
? parseInt(process.env.MAX_REQUEST_BODY_SIZE)
: 1024 * 1024 * 1024 * 10, // Default 10GB
routes: {
// Serve index.html for root
'/': index,
@@ -361,26 +361,36 @@ export function FileBrowser({
const isCurrentFolderUpload = variables.json.parentId === assetId
if (isCurrentFolderUpload) {
const newLocalFiles: AssetInfo[] = filesToUpload.map((f) => {
const urlInfo = (
data.presignedUrls as { id?: string; url?: string; fileId?: string }[] | undefined
)?.find((p) => p.id === f.id)
const hasUrl = !!urlInfo && !!urlInfo.url
return {
id: urlInfo?.fileId || f.id,
name: f.file.name,
sizeByte: f.file.size,
fileCount: 0,
type: 'file',
status: hasUrl ? 'uploading' : 'error',
mediaType: f.file.type || null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
}
})
const newLocalFiles: AssetInfo[] = filesToUpload
.filter((f) => {
const path = (f.file.webkitRelativePath || f.file.name).split('/')
return path.length === 1
})
.map((f) => {
const urlInfo = (
data.presignedUrls as { id?: string; url?: string; fileId?: string }[] | undefined
)?.find((p) => p.id === f.id)
const hasUrl = !!urlInfo && !!urlInfo.url
return {
id: urlInfo?.fileId || f.id,
name: f.file.name,
sizeByte: f.file.size,
fileCount: 0,
type: 'file',
status: hasUrl ? 'uploading' : 'error',
mediaType: f.file.type || null,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
}
})
setLocalUploadingFiles((prev) => [...newLocalFiles, ...prev])
}
// Invalidate queries immediately so any newly created folders appear
queryClient.invalidateQueries({
queryKey: ['search', teamId, assetId],
})
// The RPC client returns an object that we cast to the expected type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await uploadFiles(filesToUpload, data.presignedUrls as any, data.taskId!)