From 57b542e8ed4335e5f66b5e008d9a8e90776ebffb Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 4 Feb 2026 13:26:06 -0800 Subject: feat: replace several files with a sqlite db (#3128) These files have been known to have corruption issues. SQLite will perform better across filesystems for reads/writes across threads, and will lock as expected. I've also put the session file in there, though I'm 50/50 on it - I'll be replacing it with keyring storage asap anyway. The key file is _not_ included. It should ~never be changed, and should be easy for the user to secure + manage themselves In the future, instead of creating more files, we can just use this as a kv store Resolves https://github.com/atuinsh/atuin/issues/2336, resolves https://github.com/atuinsh/atuin/issues/1650 ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing --- crates/atuin-client/src/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/atuin-client/src/sync.rs') diff --git a/crates/atuin-client/src/sync.rs b/crates/atuin-client/src/sync.rs index 57ac18e4..4c236de4 100644 --- a/crates/atuin-client/src/sync.rs +++ b/crates/atuin-client/src/sync.rs @@ -53,7 +53,7 @@ async fn sync_download( let mut last_sync = if force { OffsetDateTime::UNIX_EPOCH } else { - Settings::last_sync()? + Settings::last_sync().await? }; let mut last_timestamp = OffsetDateTime::UNIX_EPOCH; @@ -194,12 +194,12 @@ async fn sync_upload( pub async fn sync(settings: &Settings, force: bool, db: &impl Database) -> Result<()> { let client = api_client::Client::new( &settings.sync_address, - settings.session_token()?.as_str(), + settings.session_token().await?.as_str(), settings.network_connect_timeout, settings.network_timeout, )?; - Settings::save_sync_time()?; + Settings::save_sync_time().await?; let key = load_key(settings)?; // encryption key -- cgit v1.3.1