feat(tui): join outbox rows to chat rows by message id
All checks were successful
ci / test (pull_request) Successful in 4m12s

`chat_with_delivery` matched pending outbox rows to chat rows by body
because `store::Message` carried no id, so an older send that was still
queued showed a delivered mark whenever a newer send of the same text had
already crossed the circuit.

`store::Message` now carries its `messages.id`, and the TUI joins
`OutboxEntry::message_id` == `Message::id`. The body match and its
newest-first fallback are gone.

`list_messages()` keeps its signature; callers that do not need the id
are untouched.
This commit is contained in:
rust-dev 2026-09-12 14:34:37 -04:00 • committed by agent
commit 2cbe7d41e5
No known key found for this signature in database
4 changed files with 89 additions and 41 deletions

View file

@ -607,11 +607,10 @@ prefix, no server.
- The tag trails the body and wraps with it, so it is never clipped away.
Correlation: a delivered row is deleted from the outbox, so an outbound message
with no row is `Sent`; pending rows are matched to messages by body, newest send
first (`chat_with_delivery`). The outbox holds no message id the UI can join on,
so two identical bodies where only the newer one is still queued attach the
marker to the newer send. An id-bearing accessor would remove that last
ambiguity; see the follow-up card noted in the PR.
with no row is `Sent`; pending rows are joined to messages on the row id —
`store::Message::id` equals `OutboxEntry::message_id` (`chat_with_delivery`).
Two identical bodies are distinct rows with distinct ids, so the marker always
lands on the row that actually owns the outbox entry.
### Size floor / target