Skip to content

Fix sleep recording - #572

Merged
lucasnewman merged 3 commits into
mainfrom
fix-sleep-recording
Sep 18, 2026
Merged

lucasnewman merged 3 commits into
mainfrom
fix-sleep-recording

Conversation

@Yavaren

@Yavaren Yavaren commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Save interrupted recordings when the Mac or display sleeps, so stopping afterward no longer fails with “stream already stopped.”
Saved audio remains in Audio < Library for manual transcription, with a notice shown when the user returns. System sleep waits up to 30 seconds for saving to finish.

@Yavaren
Yavaren marked this pull request as draft September 16, 2026 12:39
@Yavaren
Yavaren marked this pull request as ready for review September 16, 2026 12:42
@lucasnewman

Copy link
Copy Markdown
Collaborator

@Yavaren Codex review:

[P2] The interruption fallback can still delete captured audio — SystemAudioMeetingRecorder.swift:157
When prepareForInterruption() has run but stopCapture() throws another error, such as failedToStopAudioCapture, this branch calls audioWriter.cancel(). That already deletes the temporary file; skipping the subsequent removeItem cannot preserve it. My reproduction left neither temporary nor final audio. Marked interruptions should attempt to finalize the captured samples before cancellation.

[P2] An interruption during startup is silently dropped — SystemAudioMeetingRecorder.swift:524
self.stream is assigned only after await stream.startCapture(). If the delegate reports an interruption while that call is suspended, this guard discards it. Startup subsequently sets isRecording = true for the stopped stream. Track the pending stream and retain startup failures before awaiting capture startup.

@Yavaren

Yavaren commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator Author

@lucasnewman fixes are out

@lucasnewman lucasnewman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@lucasnewman
lucasnewman merged commit e07e909 into main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants