Skip to content

Commit

Permalink
fix: stubs handling the reply as well
Browse files Browse the repository at this point in the history
  • Loading branch information
tuddman committed Jul 31, 2024
1 parent 400c82b commit aba3ce2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/cli/cli-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ enum Commands {
#[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')]
account_addresses: Vec<String>,
},
SyncHistory {},
HistorySyncRequest {},
ReplyToHistorySyncRequest {},
/// Information about the account that owns the DB
Info {},
Clear {},
Expand Down Expand Up @@ -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 {} => {
Expand Down Expand Up @@ -371,7 +380,7 @@ async fn create_client(cli: &Cli, account: IdentityStrategy) -> Result<Client, C

let client = builder.build().await.map_err(CliError::ClientBuilder)?;
client.allow_history_sync().await.unwrap();

Ok(client)
}

Expand Down

0 comments on commit aba3ce2

Please sign in to comment.