diff --git a/apps/web/src/index.ts b/apps/web/src/index.ts index 0b57405e..c00c70d6 100644 --- a/apps/web/src/index.ts +++ b/apps/web/src/index.ts @@ -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, diff --git a/packages/webui/components/file-browser/file-browser.tsx b/packages/webui/components/file-browser/file-browser.tsx index 2842d2af..4fb8520e 100644 --- a/packages/webui/components/file-browser/file-browser.tsx +++ b/packages/webui/components/file-browser/file-browser.tsx @@ -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!)