feat(outbox): local retry queue for chat sends
All checks were successful
ci / test (pull_request) Successful in 3m22s
All checks were successful
ci / test (pull_request) Successful in 3m22s
Queue a chat send locally when the peer's v3 onion is unreachable and retry it with exponential backoff (30s doubling, capped at 30 min, 8 attempts then terminal Failed). Still peer-to-peer: no server, no store-and-forward relay, no new frame prefix — every attempt is a fresh Noise IK handshake. - src/outbox.rs: Outbox + Deliverer + ArtiDeliverer, pure backoff_secs(), is_permanent_send_error(), background worker (15s scan). - store: `outbox` table (no body column — the body is read from the joined messages row, under that row's existing AEAD + AAD), append_message_id(), queue/due/pending/mark_* helpers, reset_sending_outbox(), wipe. - Node::send() returns Result<OutboxStatus, String> (Sent/Queued) instead of Err on transport failure; protocol errors still fail immediately and are never queued. - Retry triggers: timer, unlock/foreground (spawn_flush_all), and "that peer was just seen" (handshake or connect_onion -> spawn_flush_friend). - File transfer and payment/rcp frames stay fail-closed. - docs/PROTOCOL.md + docs/THREAT_MODEL.md: replace the no-queue statements; add the seizure/cadence delta to the threat model. src/tui.rs gets one forced arm change (Ok(()) -> Ok(_)); UI surfacing is child card t_d9a5b065.
This commit is contained in:
parent
e6e2a158a8
commit
068b655c19
9 changed files with 1042 additions and 53 deletions
|
|
@ -1449,8 +1449,10 @@ impl App {
|
|||
let (tx, rx) = mpsc::channel();
|
||||
self.status_note = Some("sending".into());
|
||||
std::mem::drop(self.rt.spawn(async move {
|
||||
// send() now reports `Sent`/`Queued`; surfacing `queued` in the
|
||||
// footer is a follow-up card, so this arm keeps today's wording.
|
||||
let note = match node.send(&pk, &body).await {
|
||||
Ok(()) => "sent".to_string(),
|
||||
Ok(_) => "sent".to_string(),
|
||||
Err(e) => format!("send failed: {e}"),
|
||||
};
|
||||
let _ = tx.send(note);
|
||||
|
|
|
|||
Loading…
Reference in a new issue