From 9d757be415527b0c3c3650f76b89cae24d29f0b7 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Mon, 6 Jul 2026 14:55:36 -0500 Subject: [PATCH] feat(calendar): one-shot PST auto-sync on launch Mirrors the existing sync-job-resume pattern right above it: runs once at startup if pst_auto_sync is on and a path is remembered, no idle timer (NFR-RES-1). Re-import is dedup'd by (source, raw_uid), so this just catches up on new/changed events since last launch. --- src-tauri/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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(()) })