Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sync): check store length after sync, not before #1805

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions atuin/src/command/client/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ async fn run(
let host_id = Settings::host_id().expect("failed to get host_id");
let history_store = HistoryStore::new(store.clone(), host_id, encryption_key);

let (uploaded, downloaded) = sync::sync(settings, &store).await?;

history_store.incremental_build(db, &downloaded).await?;

println!("{uploaded}/{} up/down to record store", downloaded.len());

let history_length = db.history_count(true).await?;
let store_history_length = store.len_tag("history").await?;

Expand All @@ -99,12 +105,6 @@ async fn run(

println!("\n");
}

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?;
}
Expand Down