fix(export): keep large exports off in-memory save path#453
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds size constraints for in-memory video exports by introducing a 2GB limit and conditional fallback policy. It defines size-checking utilities and applies them across IPC handlers and client-side fallback logic, with tests validating the policy behavior. ChangesIn-Memory Export Size Guards
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Description
Fixes #445 by keeping MP4 export saves on the temp-file streaming/finalize path instead of silently falling back to renderer/main-process
ArrayBuffersaves when the output is large or when Electron MP4 streaming fails.Motivation
The v1.3.0 beta still had a legacy in-memory save path that could be reached after a Blob export. For outputs over Node/Electron's Buffer limit, that path can fail with the same
>2 GiBclass of error reported in #445.Type
Bug fix
Related Issue(s)
Fixes #445
Changes Made
blob.arrayBuffer()path after temp-file streaming fails.ArrayBuffersaves with a clear message.Scope Note
This does not change rendering, muxing quality, or native CUDA/D3D11 selection. It only hardens the final save/mux handoff so large exports stay on disk-backed paths.
Testing Guide
Validation
npm test -- src/lib/exporter/exportSavePolicy.test.ts electron/ipc/export/exportStream.test.ts electron/ipc/register/export.test.ts src/lib/exporter/muxer.test.tsnpm exec -- tsc --noEmitnpx biome check --formatter-enabled=false src/lib/exporter/exportSavePolicy.ts src/lib/exporter/exportSavePolicy.test.ts src/components/video-editor/VideoEditor.tsx electron/ipc/register/export.tsnpx vite build --config vite.config.tsnpm run normalize:electron-main-cjsnpm run smoke:electron-main-cjsChecklist
Summary by CodeRabbit
New Features
Bug Fixes