Merge pull request 'docs+tui: reachability stance (no sealed mailbox) and peer-unreachable queued footer' (#99) from wt/t_d662c8a6 into main
Some checks failed
android-ci / android (push) Successful in 8m31s
ci / test (push) Successful in 4m57s
ci / sdk (push) Successful in 1m5s
ci / fuzz (push) Failing after 36s

Reviewed-on: #99
This commit is contained in:
sirius 2026-09-18 01:02:21 +00:00
commit 407b11f2f8
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.