use fred::{interfaces::StreamsInterface, types::Key};
use xkv::R;

pub async fn rm_err_id_li(
  stream: &Key,
  group: &str,
  err_id_li: Vec<String>,
) -> fred::prelude::FredResult<()> {
  // wait for xackdel https://github.com/apache/kvrocks/pull/3275
  let p = R.pipeline();
  let _: () = p.xack(stream, group, err_id_li.clone()).await?;
  let _: () = p.xdel(stream, err_id_li).await?;
  p.last().await
}
