Skip to content

Commit 1e87ae3

Browse files
committed
Fix pre-aborted signal, pptx-worker tracing, and binary fetch cache
1 parent 5de3616 commit 1e87ae3

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

apps/sim/hooks/queries/workspace-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function useWorkspaceFileContent(
103103

104104
async function fetchWorkspaceFileBinary(key: string, signal?: AbortSignal): Promise<ArrayBuffer> {
105105
const serveUrl = `/api/files/serve/${encodeURIComponent(key)}?context=workspace`
106-
const response = await fetch(serveUrl, { signal })
106+
const response = await fetch(serveUrl, { signal, cache: 'no-store' })
107107
if (!response.ok) throw new Error('Failed to fetch file content')
108108
return response.arrayBuffer()
109109
}

apps/sim/lib/execution/pptx-vm.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ export async function generatePptxFromCode(
7272
else resolve(result as Buffer)
7373
}
7474

75+
if (signal?.aborted) {
76+
reject(new Error('PPTX generation cancelled'))
77+
return
78+
}
79+
7580
signal?.addEventListener('abort', () => done(new Error('PPTX generation cancelled')), {
7681
once: true,
7782
})

apps/sim/next.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ const nextConfig: NextConfig = {
9393
'/*': [
9494
'./node_modules/sharp/**/*',
9595
'./node_modules/@img/**/*',
96-
// pptxgenjs is required by the PPTX worker subprocess at runtime.
97-
// It has no static import that Next.js can trace, so we include it explicitly.
96+
// pptxgenjs and the PPTX worker are required at runtime by the subprocess.
97+
// Neither has a static import that Next.js can trace, so we include them explicitly.
9898
'./node_modules/pptxgenjs/**/*',
99+
'./lib/execution/pptx-worker.cjs',
99100
],
100101
},
101102
experimental: {

0 commit comments

Comments
 (0)