⚡ Bolt: Prevent main thread blocking during I/O operations#61
⚡ Bolt: Prevent main thread blocking during I/O operations#61
Conversation
Offloads synchronous operations (`DiskInfo.current()`, `process.waitUntilExit()`) from the `@MainActor` to background threads using `Task.detached`. This prevents UI stalls during scanning and Docker pruning. Also adds a journal entry to `.jules/bolt.md` documenting this learning. Co-authored-by: acebytes <2820910+acebytes@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Refactored synchronous file I/O and process execution within
@MainActorasyncmethods to run insideawait Task.detached { ... }.value. Added a performance learning to.jules/bolt.md.🎯 Why: In Swift Concurrency,
asyncmethods on a@MainActorexecute on the main thread. If they perform synchronous, blocking operations (like fetchingURLResourceValuesforDiskInfoor waiting for aProcessto exit), they will block the UI thread, causing freezes and degraded user experience.📊 Impact: Eliminates UI stutter/freezes when initiating a scan (which checks disk info) and during the Docker prune operation (which executes a blocking sub-process). Application remains fully responsive.
🔬 Measurement:
PR created automatically by Jules for task 7742641724414580977 started by @acebytes