docs+tui: reachability stance (no sealed mailbox) and peer-unreachable queued footer
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
android-ci / android (pull_request) Has been cancelled

Add a Reachability section to docs/THREAT_MODEL.md: no sealed mailbox or
server-side message store, the chat outbox is local-device retry only, and
there is no mutual-online indicator — a send is a one-shot Noise IK session
and an unanswered dial queues locally with the retry clock shown.

OutboxSummary now carries the outstanding row's attempt count and soonest
retry, so the footer reads 'peer unreachable, queued (n/8, retry 45s)'
instead of a bare 'n queued'. Tests updated to the real outbox wording; the
Android KDoc note stops claiming the footer copy is mirrored (Android shows
per-row 'queued (try n/8, retry …)' via OutboxDetail).
This commit is contained in:
agent 2026-09-17 20:44:28 -04:00
commit dff37fe00e
No known key found for this signature in database
4 changed files with 79 additions and 14 deletions

View file

@ -531,7 +531,10 @@ fn identical_bodies_join_by_message_id_not_body() {
"delivered row (id 8) must keep its mark: {:?}",
lines[1]
);
assert_eq!(summary.note().as_deref(), Some("1 queued"));
assert_eq!(
summary.note().as_deref(),
Some("peer unreachable, queued (1/8, retry 30s)")
);
}
#[test]
@ -621,13 +624,19 @@ fn footer_summary_counts_queued_and_keeps_fail_closed() {
queued: 2,
failed: 0,
first_error: None,
attempts: 3,
next_in_secs: Some(45),
};
assert_eq!(queued.note().as_deref(), Some("2 queued"));
assert_eq!(
queued.note().as_deref(),
Some("peer unreachable, queued (3/8, retry 45s)")
);
let failed = OutboxSummary {
queued: 0,
failed: 1,
first_error: Some("connect peer.onion:80: connection timed out".into()),
..OutboxSummary::default()
};
let note = failed.note().expect("failed rows must produce a note");
assert!(note.starts_with("send failed:"), "{note:?}");
@ -637,9 +646,15 @@ fn footer_summary_counts_queued_and_keeps_fail_closed() {
queued: 3,
failed: 1,
first_error: Some("connect peer.onion:80: connection timed out".into()),
attempts: 2,
next_in_secs: Some(60),
};
let mixed_note = mixed.note().expect("mixed rows must produce a note");
assert!(mixed_note.contains("3 queued"), "{mixed_note:?}");
assert!(
mixed_note.contains("queued (2/8, retry 1m)"),
"{mixed_note:?}"
);
assert!(mixed_note.starts_with("peer unreachable"), "{mixed_note:?}");
assert!(mixed_note.contains("send failed"), "{mixed_note:?}");
// Fail-closed copy stays visible in the real footer at the 80-col floor.
@ -653,7 +668,10 @@ fn footer_summary_counts_queued_and_keeps_fail_closed() {
assert!(line.contains("TOR") && line.contains("? help"), "{line:?}");
let queued_line = status_footer(80, FP, ONION, queued.note().as_deref(), main_footer_hints());
assert!(queued_line.contains("2 queued"), "{queued_line:?}");
assert!(
queued_line.contains("queued (3/8, retry 45s)"),
"{queued_line:?}"
);
assert!(queued_line.chars().count() <= 80);
// `! ` ornament (colour off) still lands on the derived failing note.
@ -731,7 +749,7 @@ fn chat_and_footer_rows_fit_80x24_and_wrap_instead_of_clipping() {
"long row was clipped, not wrapped:\n{screen}"
);
assert!(
screen.contains("1 queued"),
screen.contains("peer unreachable, queued (3/8, retry 45s)"),
"footer summary missing:\n{screen}"
);
println!("===== AFTER outbox 80x24 (real draw_chat + status_footer) =====\n{screen}");
@ -789,7 +807,10 @@ async fn renders_a_queued_row_from_a_real_outbox_send() {
"real outbox row did not render: {:?}",
lines[0]
);
assert_eq!(summary.note().as_deref(), Some("1 queued"));
assert_eq!(
summary.note().as_deref(),
Some("peer unreachable, queued (1/8, retry 45s)")
);
// And once a send crosses the circuit the row is gone, so the same message
// renders as delivered.