Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Fix crash an hour after a file edit

alessio.vigilanted05f22b2ad4e
diff --git a/NotchBuddy/Sources/App/AppState.swift b/NotchBuddy/Sources/App/AppState.swift
index 22a097cf..e20faddc 100644
--- a/NotchBuddy/Sources/App/AppState.swift
+++ b/NotchBuddy/Sources/App/AppState.swift
@@ -376,11 +376,13 @@ final class AppState: ObservableObject {
private func resetSessionDiffTimer(for pillId: String) {
sessionDiffTimers[pillId]?.cancel()
+ // The closure is MainActor-isolated (AppState is @MainActor): it must run on the main
+ // queue. Scheduled on a global queue, Swift 6's isolation check traps and the app quits.
let work = DispatchWorkItem { [weak self] in
- DispatchQueue.main.async { self?.clearSessionDiffs(for: pillId) }
+ self?.clearSessionDiffs(for: pillId)
}
sessionDiffTimers[pillId] = work
- DispatchQueue.global().asyncAfter(deadline: .now() + 3600, execute: work)
+ DispatchQueue.main.asyncAfter(deadline: .now() + 3600, execute: work)
}
#if !APPSTORE