diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index b5c334f..f2acc9d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -161,6 +161,22 @@ pub fn run() { if commands::load_settings().sync_enabled { commands::pump_sync(&startup_app, store.as_ref()).await; } + + // Re-import the last .pst path if the user opted into auto-sync + // (T6.2). One-shot on startup, same as the sync-job resume above + // — no idle timer (NFR-RES-1). Re-import is dedup'd by + // (source, raw_uid), so this just catches up on new/changed events. + let pst_settings = commands::load_settings(); + if pst_settings.pst_auto_sync { + if let Some(path) = pst_settings.pst_last_path { + if let Err(e) = + commands::import_pst_core(&startup_app, store.as_ref(), path, None) + .await + { + tracing::warn!("startup PST auto-sync failed: {e:?}"); + } + } + } }); Ok(()) })