diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 28ce5d1..6a61c66 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -8,6 +8,7 @@ use std::{ process::{Command, Output}, }; +use async_std::stream::StreamExt; use async_std::task; use dirs; use futures::stream::TryStreamExt; @@ -134,7 +135,11 @@ pub fn latest_sequence_number() -> Result> { let id = sbot_client.whoami().await?; let history_stream = sbot_client.create_history_stream(id).await?; - let mut msgs: Vec = history_stream.try_collect().await?; + let msg_stream = history_stream.map(|res| match res { + Ok(kvt) => Ok(kvt.value), + Err(err) => Err(err), + }); + let mut msgs: Vec = msg_stream.try_collect().await?; // there will be zero messages when the sbot is run for the first time if msgs.is_empty() {