Fix: Fix debug recording lost after app restart#441
Merged
Conversation
The debug recording trigger file now stores the session directory path and start timestamp. On app restart, the recorder resumes into the same session directory and log file instead of creating a new one, preserving the original start time so the short-recording guard doesn't reset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Fixed debug recording being lost when the app restarts. Previously, restarting the app during a recording would create a new log file and reset the recording timer, causing the "short recording" warning to appear even after a long recording. Now the recording continues into the same log file and preserves the original start time.
Technical Context
RecorderModulestored the session directory path and start timestamp only in memory. On restart, the trigger file (capod_force_debug_run) signaled "resume recording" but the recorder always created a fresh session directory, losing the previous one to auto-zipping as an orphan.readTriggerFile()parses them back, and the recorder resumes into the existing session directory.FileLoggeralready opens in append mode, so log continuity works naturally.1..now+60s), directory existence is verified, and all file I/O is wrapped in try/catch with fallbacks.