Migrated from upstream OpenScreen issue: https://github.com/siddharthvaddem/openscreen/issues/688
Source: siddharthvaddem/openscreen#688
Upstream labels: none
Summary
Currently, the native Windows finalize path (finalizeNativeWindowsRecording in src/hooks/useScreenRecorder.ts) reads the entire on-disk screen recording back into renderer memory via window.electronAPI.readBinaryFile(nativeScreenPath) and ships those bytes to the main process via storeRecordedSession. For long recordings this can be a multi-GB IPC transfer and risks an OOM crash in the renderer on stop — even after the webcam sidecar OOM fix in #687.
Proposed fix
Add a dedicated main-process IPC handler (e.g. attach-webcam-to-screen-recording) that accepts:
- The native screen file path (already on disk)
- The webcam sidecar file name / whether it is streamed
- A small duration-fixed webcam blob buffer (only when not streamed)
The main process reads, patches, and merges the files itself — the renderer never marshals the multi-GB screen bytes over IPC.
Context
Acceptance criteria
Migrated from upstream OpenScreen issue:
https://github.com/siddharthvaddem/openscreen/issues/688Source:
siddharthvaddem/openscreen#688Upstream labels: none
Summary
Currently, the native Windows finalize path (
finalizeNativeWindowsRecordinginsrc/hooks/useScreenRecorder.ts) reads the entire on-disk screen recording back into renderer memory viawindow.electronAPI.readBinaryFile(nativeScreenPath)and ships those bytes to the main process viastoreRecordedSession. For long recordings this can be a multi-GB IPC transfer and risks an OOM crash in the renderer on stop — even after the webcam sidecar OOM fix in #687.Proposed fix
Add a dedicated main-process IPC handler (e.g.
attach-webcam-to-screen-recording) that accepts:The main process reads, patches, and merges the files itself — the renderer never marshals the multi-GB screen bytes over IPC.
Context
Acceptance criteria
readBinaryFile(nativeScreenPath)is removed from the renderer finalize pathtsc --noEmit,biome check, andvitestchecks remain green