From aba3ce289d08795b65e5a6542c2f97cee5e7b2e0 Mon Sep 17 00:00:00 2001 From: tuddman Date: Wed, 31 Jul 2024 18:45:17 +0200 Subject: [PATCH] fix: stubs handling the reply as well --- examples/cli/cli-client.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/cli/cli-client.rs b/examples/cli/cli-client.rs index cc5bbb50b..b0b76ea0b 100755 --- a/examples/cli/cli-client.rs +++ b/examples/cli/cli-client.rs @@ -108,7 +108,8 @@ enum Commands { #[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')] account_addresses: Vec, }, - SyncHistory {}, + HistorySyncRequest {}, + ReplyToHistorySyncRequest {}, /// Information about the account that owns the DB Info {}, Clear {}, @@ -334,13 +335,21 @@ async fn main() { let serializable: SerializableGroup = group.into(); info!("Group {}", group_id, { command_output: true, group_id: group_id, group_info: make_value(&serializable) }) } - Commands::SyncHistory {} => { + Commands::HistorySyncRequest {} => { let client = create_client(&cli, IdentityStrategy::CachedOnly) .await .unwrap(); - client.allow_history_sync().await.unwrap(); + // client.allow_history_sync().await.unwrap(); client.sync_welcomes().await.unwrap(); client.send_history_request().await.unwrap(); + info!("Sent history sync request", { command_output: true }); + } + Commands::ReplyToHistorySyncRequest {} => { + let client = create_client(&cli, IdentityStrategy::CachedOnly) + .await + .unwrap(); + client.sync_welcomes().await.unwrap(); + // Note: sending a reply should trigger automatically when processing the request info!("Synced history", { command_output: true }); } Commands::Clear {} => { @@ -371,7 +380,7 @@ async fn create_client(cli: &Cli, account: IdentityStrategy) -> Result