Compare commits

..
Author SHA1 Message Date
rust-dev (hermes)
37742a5e09
feat(sdk): expose the outbox rows behind a queued chat message
Some checks failed
ci / test (pull_request) Successful in 3m55s
ci / sdk (pull_request) Failing after 25s
The TUI can say why a queued row is still queued ('queued (try n/8,
retry 45s)') because it reads OutboxEntry::attempts and next_attempt_at
directly. The SDK exposed neither: ChatMessage.delivery is a flat
'queued'/'sending'/'failed: <reason>' string and Wire had no outbox
accessor, so an Android chat row could only invent a countdown.

Adds OutboxRow { message_id, status, attempts, next_attempt_at,
last_error } and Wire::outbox(pubkey_hex) over Node::outbox_pending, plus
outbox_max_attempts() so the client renders 'try n/8' against the core's
own budget instead of a hardcoded 8. Additive: Wire::send() and
ChatMessage.delivery are untouched.

# Conflicts:
#	crates/onionwire-sdk/src/lib.rs
2026-09-12 17:17:55 -04:00

View file

@ -450,7 +450,7 @@ impl Wire {
/// the client. An empty result means nothing is outstanding for that friend.
pub async fn outbox(&self, pubkey_hex: String) -> WResult<Vec<OutboxRow>> {
let pk = unhex(&pubkey_hex)?;
let rows = self.node()?.outbox_pending(&pk).map_err(WireError::new)?;
let rows = self.inner.outbox_pending(&pk).map_err(WireError::new)?;
Ok(rows.iter().map(outbox_row).collect())
}