| … | … | @@ -311,6 +312,34 @@ export const openExternal = DesktopIpc.makeIpcMethod({ | |
| 334 | + | return { | |
| 335 | + | status: response.status, | |
| 336 | + | mimeType: response.headers.get("content-type") ?? "", | |
| 337 | + | data: new Uint8Array(await response.arrayBuffer()), | |
🟠 High methods/window.ts:337
Saving a large video through downloadMedia buffers the entire remote response in the Electron main process, which can exhaust memory and terminate the desktop app. response.arrayBuffer() reads the body to completion without a size limit; enforce a streamed byte limit and cancel oversized responses, or stream saves directly to a file, and reject unsuccessful responses before reading their bodies.
No longer relevant as of b65a276950dc60044cc452f5d4345457f610e93b
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Fixed in b65a276. The main process now streams the body and stops at 256 MiB, returning 413 with no bytes. The renderer shows "The file could not be fetched (HTTP 413)." instead of the app crashing. Non-2xx responses return before their body is read. window.test.ts streams 257 MiB and expects 413. With the cap removed, that test's worker aborts on memory.