Skip to content

Fix: Fix debug recording lost after app restart#441

Merged
d4rken merged 1 commit intomainfrom
fix/debug-recording-survive-restart
Mar 9, 2026
Merged

Fix: Fix debug recording lost after app restart#441
d4rken merged 1 commit intomainfrom
fix/debug-recording-survive-restart

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 9, 2026

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

  • Root cause: RecorderModule stored 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.
  • Fix: The trigger file now stores the session directory path and start timestamp (two lines of text). On restart, readTriggerFile() parses them back, and the recorder resumes into the existing session directory. FileLogger already opens in append mode, so log continuity works naturally.
  • Backward compatible: empty trigger files from older app versions are treated as a fresh start (no crash, no data loss).
  • Validation: persisted timestamps are range-checked (1..now+60s), directory existence is verified, and all file I/O is wrapped in try/catch with fallbacks.

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.
@d4rken d4rken added the bug Something isn't working label Mar 9, 2026
@d4rken d4rken merged commit 8675d73 into main Mar 9, 2026
9 checks passed
@d4rken d4rken deleted the fix/debug-recording-survive-restart branch March 9, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant