Skip to content

Commit 94914b8

Browse files
waleedlatif1claude
andcommitted
fix: bust browser cache for workspace file downloads
The downloadFile function was using a plain fetch() that honored the aggressive cache headers, causing newly created files to download empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8fc75a6 commit 94914b8

File tree

1 file changed

+2
-2
lines changed
  • apps/sim/app/workspace/[workspaceId]/files

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ function formatFileType(mimeType: string | null, filename: string): string {
115115
}
116116

117117
async function downloadFile(file: WorkspaceFileRecord) {
118-
const serveUrl = `/api/files/serve/${encodeURIComponent(file.key)}?context=workspace`
119-
const response = await fetch(serveUrl)
118+
const serveUrl = `/api/files/serve/${encodeURIComponent(file.key)}?context=workspace&t=${Date.now()}`
119+
const response = await fetch(serveUrl, { cache: 'no-store' })
120120
if (!response.ok) {
121121
throw new Error(`Failed to download file: ${response.statusText}`)
122122
}

0 commit comments

Comments
 (0)