Skip to content

General: Add debug session manager and improve recording workflow#431

Merged
d4rken merged 11 commits intomainfrom
refactor/debug-session-model
Mar 9, 2026
Merged

General: Add debug session manager and improve recording workflow#431
d4rken merged 11 commits intomainfrom
refactor/debug-session-model

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 5, 2026

What changed

Debug log sessions now have a unified lifecycle that shows recording, compressing, and ready states. After stopping a recording, the app automatically compresses the log in the background instead of requiring manual steps. The Support screen now has a session manager bottom sheet where you can view all debug sessions, open completed ones, delete individual sessions, or clear all at once.

Technical Context

  • Extracted DebugSessionManager from RecorderModuleRecorderModule now owns only the recording lifecycle, while DebugSessionManager handles session scanning, compression, deletion, and orphan recovery
  • Introduced DebugSession sealed interface (Recording, Compressing, Ready, Failed) as the single source of truth for session state
  • Ready now carries zipFile: File? and compressedSize: Long directly, eliminating redundant I/O in consumers
  • Session state is reactive via combine(recorderState, zippingIds, failedZipIds, refreshTrigger) with replayingShare(appScope)
  • All filesystem mutations guarded by fsMutex (including zipSessionAsync) to prevent races between zip and delete
  • Orphan detection (reconcileOrphans) auto-zips Ready sessions missing a zip file, using live zippingIds.value to avoid re-triggering
  • RecorderActivityVM reads session.compressedSize directly instead of calling zipSession().length()
  • Added 25 unit tests covering Zipper, DebugLogZipper, RecorderModule.State, and scanSessions edge cases

@d4rken d4rken added the enhancement Add a new feature of improve an existing feature label Mar 5, 2026
d4rken added 7 commits March 8, 2026 10:33
…ger bottom sheet

Introduce DebugSession sealed interface as single source of truth for session lifecycle (Recording, Compressing, Ready, Failed). Auto-compress after recording stops. Replace scattered clear/delete actions with a session manager bottom sheet on the Support screen.
…n manager

Add zipFile and compressedSize fields to DebugSession.Ready, populated during scan. Simplify RecorderActivityVM by reading compressed size directly from session model. Apply code review fixes: fsMutex in zipSessionAsync, CancellationException handling, ZipOutputStream use{}, atomic file moves, dedup deriveSessionId, LifecycleResumeEffect for session refresh.
@d4rken d4rken force-pushed the refactor/debug-session-model branch from 0878d62 to d7b29d2 Compare March 8, 2026 09:34
@d4rken d4rken marked this pull request as ready for review March 8, 2026 09:36
d4rken added 3 commits March 9, 2026 05:15
…ty in session manager

Replace sessions.first() inside fsMutex.withLock with synchronous volatile

read to avoid potential deadlock. Wrap file deletions in IO dispatcher.

Log partial delete failures. Make pendingAutoZips thread-safe via

Collections.synchronizedSet. Add test for ext/cache same-basename IDs.
Replace Array<String> with List<String> in Zipper.zip().

Add global -opt-in flag for ExperimentalMaterial3Api in build.gradle.kts

and remove per-file @OptIn annotations from 12 Compose screens.
@d4rken d4rken merged commit a76e43a into main Mar 9, 2026
9 checks passed
@d4rken d4rken deleted the refactor/debug-session-model branch March 9, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Add a new feature of improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant