diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index 4b0c98c..2492283 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -12,7 +12,7 @@ use atuin_common::api::{ }; use atuin_common::utils::hash_str; -use crate::encryption::{decode_key, decrypt, EncryptedHistory}; +use crate::encryption::{decode_key, decrypt}; use crate::history::History; static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"),); @@ -140,10 +140,7 @@ impl<'a> Client<'a> { Ok(history) } - pub async fn post_history( - &self, - history: &[AddHistoryRequest<'_, EncryptedHistory>], - ) -> Result<()> { + pub async fn post_history(&self, history: &[AddHistoryRequest<'_, String>]) -> Result<()> { let url = format!("{}/history", self.sync_addr); let url = Url::parse(url.as_str())?; diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs index 16524fc..c1c02b0 100644 --- a/atuin-client/src/sync.rs +++ b/atuin-client/src/sync.rs @@ -107,6 +107,8 @@ async fn sync_upload( for i in last { let data = encrypt(&i, &key)?; + let data = serde_json::to_string(&data)?; + let add_hist = AddHistoryRequest { id: i.id.into(), timestamp: i.timestamp,