Extract PatchSeries module and remove require_relay_accepted helper

This commit is contained in:
2026-10-13 09:20:08 +07:00
parent 4a57a01f4a
commit b4c3565484
7 changed files with 129 additions and 196 deletions
+1 -20
View File
@@ -1,7 +1,7 @@
use std::path::Path;
use std::time::Duration;
use anyhow::{Error, bail};
use anyhow::Error;
use gpui::BackgroundExecutor;
use nostr::prelude::Url;
use nostr_sdk::prelude::*;
@@ -10,7 +10,6 @@ use signed_git::{Repo, RepoRefState};
use signed_nostr::UniversalSigner;
const GRASP_PUSH_ATTEMPTS: usize = 3;
const GRASP_RETRY_DELAY: Duration = Duration::from_secs(1);
/// `ws://` grasp servers, like ngit, use `http(s)://<host>`.
@@ -136,24 +135,6 @@ impl PushOutcome {
}
}
pub(crate) fn require_relay_accepted(
output: SendEventOutput,
event: Event,
) -> Result<Event, Error> {
if output.success.is_empty() && !output.failed.is_empty() {
let reasons = output
.failed
.values()
.cloned()
.collect::<Vec<String>>()
.join(", ");
bail!("event not accepted by any relay: {reasons}");
}
Ok(event)
}
/// Signs with a `created_at` strictly newer than `last_created_at`,
/// since a relay treats a same-id resend as a duplicate.
async fn sign_state_event(