Skip to content

Fix: Fix debug log sharing crash and improve session cleanup#440

Merged
d4rken merged 1 commit intomainfrom
fix/debug-session-robustness
Mar 9, 2026
Merged

Fix: Fix debug log sharing crash and improve session cleanup#440
d4rken merged 1 commit intomainfrom
fix/debug-session-robustness

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 9, 2026

What changed

  • Fixed a crash that could happen when sharing debug logs if zipping fails (e.g., disk full)
  • Fixed debug logs not being shareable when only the compressed file exists (no raw log directory)
  • Improved cleanup when deleting all debug sessions to properly reset internal tracking state
  • Moved automatic compression of orphaned debug sessions out of the data pipeline to prevent redundant work

Technical Context

  • RecorderActivityVM.share() had no error handling around getZipUri() and the VM doesn't implement ErrorEventSource, so any exception would crash. Added try-catch with logging.
  • share() also guarded on logDir being non-null, which silently prevented sharing zip-only sessions. getZipUri() only needs the session ID, not the log directory. Removed the guard.
  • DebugSessionManager.sessions combine lambda launched auto-zip coroutines as a side effect. Moved orphan detection to a separate init collector with atomic pendingAutoZips.add() as the sole dedup guard, keeping the combine transformation pure.
  • deleteAllSessions() cleared failedZipIds but not pendingAutoZips, leaving stale entries. Added pendingAutoZips.clear().
  • Replaced two !! operators with requireNotNull for clearer crash messages if invariants are ever violated.

@d4rken d4rken added the bug Something isn't working label Mar 9, 2026
@d4rken d4rken merged commit 0008370 into main Mar 9, 2026
16 of 17 checks passed
@d4rken d4rken deleted the fix/debug-session-robustness branch March 9, 2026 16:39
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