From 011ab411cc108757c73181c8e12c74a438eef053 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Fri, 7 Aug 2026 16:37:03 -0700 Subject: [PATCH] fix(desktop): tolerate native relaunch setup errors Keep tray and notification initialization failures from aborting Tauri startup during a rapid reset and relaunch. Co-authored-by: Taylor Ho Signed-off-by: Taylor Ho --- desktop/src-tauri/src/lib.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index 66816f8b9..7ad1bbeb7 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -312,8 +312,18 @@ pub fn run() { let app_handle = app.handle().clone(); #[cfg(target_os = "macos")] { - tray_menu::init(&app_handle)?; - macos_notifications::init(&app_handle)?; + // Native conveniences must not take down the whole app. In + // particular, a rapid reset/relaunch can briefly leave macOS + // resources from the exiting process unavailable; propagating + // either error out of Tauri's setup callback panics across the + // Objective-C applicationDidFinishLaunching boundary and macOS + // reports the clean relaunch as a crash. + if let Err(error) = tray_menu::init(&app_handle) { + eprintln!("buzz-desktop: failed to initialize tray menu: {error}"); + } + if let Err(error) = macos_notifications::init(&app_handle) { + eprintln!("buzz-desktop: failed to initialize notifications: {error}"); + } } // ── Phase 2: boot-time sentinel wipe ──────────────────────────────