From f943e03f905f09ad71e234974a6c868d06d0bbe5 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 6 Mar 2024 15:16:07 +0000 Subject: fix(store-init): re-sync after running auto store init (#1834) --- atuin/src/command/client/sync.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atuin/src/command/client/sync.rs b/atuin/src/command/client/sync.rs index 1fb64a6e..4889cbca 100644 --- a/atuin/src/command/client/sync.rs +++ b/atuin/src/command/client/sync.rs @@ -105,7 +105,17 @@ async fn run( println!("Running automatic history store init..."); // Internally we use the global filter mode, so this context is ignored. + // don't recurse or loop here. history_store.init_store(db).await?; + + println!("Re-running sync due to new records locally"); + + // we'll want to run sync once more, as there will now be stuff to upload + let (uploaded, downloaded) = sync::sync(settings, &store).await?; + + history_store.incremental_build(db, &downloaded).await?; + + println!("{uploaded}/{} up/down to record store", downloaded.len()); } } else { atuin_client::sync::sync(settings, force, db).await?; -- cgit v1.2.3