General: Add debug session manager and improve recording workflow#431
Merged
General: Add debug session manager and improve recording workflow#431
Conversation
…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.
…e.State, and scanSessions edge cases
…ers, add pendingAutoZips guard
0878d62 to
d7b29d2
Compare
…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.
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
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
DebugSessionManagerfromRecorderModule—RecorderModulenow owns only the recording lifecycle, whileDebugSessionManagerhandles session scanning, compression, deletion, and orphan recoveryDebugSessionsealed interface (Recording,Compressing,Ready,Failed) as the single source of truth for session stateReadynow carrieszipFile: File?andcompressedSize: Longdirectly, eliminating redundant I/O in consumerscombine(recorderState, zippingIds, failedZipIds, refreshTrigger)withreplayingShare(appScope)fsMutex(includingzipSessionAsync) to prevent races between zip and deletereconcileOrphans) auto-zips Ready sessions missing a zip file, using livezippingIds.valueto avoid re-triggeringRecorderActivityVMreadssession.compressedSizedirectly instead of callingzipSession().length()