You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
start_recording in flight during shutdown leaves ffmpeg capturing after exit #285
shutdown() stops the sessions that exist when it runs and then exits. A start_recording that is between consent and store.create (1-2 s of awaits) is not seen, and its gdigrab/ddagrab ffmpeg keeps recording the screen with no owner.
src/tools/startRecording.ts:210-481 (no isShuttingDown() check; child attached ~:437)
src/utils/jobs.ts:138 (edit jobs already refuse via jobsClosed)
Details
start_recording awaits confirmCapture, resolveLoopbackDevice, resolveEncoder and settleCapture before the session is registered. Edit jobs got a shutdown guard in #237; recordings did not. gdigrab ffmpeg does not stop when its stdin closes (see the #76 comment at src/index.ts:59-62).
Impact
A client that disconnects while a recording is starting leaves the screen being recorded until maxDurationSec (default 3600 s) or the next server start. Same privacy problem as #76 by a different path.
Steps to reproduce
Call start_recording
Close the client's stdin within ~1 s (during settleCapture)
ffmpeg.exe is still running after node exits
Suggested fix
Check isShuttingDown() right after spawn and before returning; if set, quit/kill the child and throw. Or track in-flight starts in a set that shutdown awaits, like activeJobs.
Acceptance criteria
No ffmpeg capture survives a shutdown that races a start
Test covering shutdown during start (fake child is fine)
Fixed in 0d96cd5: start_recording now registers itself as in flight (beginStart in src/context.ts) and is refused once shutdown begins; shutdown() waits up to 10 s for in-flight starts before stopAll, so their sessions are registered and stopped. Verified with unit tests in src/tests/startGuard.test.ts plus build/typecheck/lint/server tests.
Activity
TMHSDigital commentedon Nov 10, 2026
Fixed in 0d96cd5: start_recording now registers itself as in flight (
beginStartin src/context.ts) and is refused once shutdown begins;shutdown()waits up to 10 s for in-flight starts beforestopAll, so their sessions are registered and stopped. Verified with unit tests in src/tests/startGuard.test.ts plus build/typecheck/lint/server tests.chore: release 0.48.2