feat(android): chat row renders queued (try 3/8, retry 45s) from the SDK outbox rows #59
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_f8658427"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
An Android chat row can now say why it is still queued:
◷ queued (try 3/8, retry 45s), read from the SDK's outbox rows instead of a flatqueued.Consumes PR #58's surface (
Wire.outbox(pubkeyHex)->OutboxRow { messageId, status, attempts, nextAttemptAt, lastError },outboxMaxAttempts()).android/**only — no Rust changes.How
ui/OutboxDetail.kt(new)retryInTextmirrorssrc/tui.rs::retry_in_text:<= 0->retry now;< 60->retry {n}s; elseretry {ceil-minutes}m((n + 59) / 60, so the app never promises an attempt sooner than the store will make one).outboxDetails(...)pairs the SDK's rows with the chat rows and returnsQueuedRowDetail { attempts, maxAttempts, nextInSecs }->queued (try 3/8, retry 45s), plus the numbers alone for the a11y announcement.outboxMaxAttempts()fetched once at chat open — the app never hardcodes 8. With the budget unknown, rows stay flat.ui/ChatScreen.kt— pollsloadOutbox()on the same 2s cadence as the bodies and computes the countdown against an injectablenowSeconds(the store holds an absolute instant; the age belongs to the client).DeliveryMarkernow rendersdeliveryMarkerText(d, detail)and announcesdeliveryAnnouncement(d, detail).WireViewModel— two thin passthroughs:outbox(pubkeyHex)andoutboxMaxAttempts(). Kept minimal: this file is a hotspot with open PR #49.Terminal
failedrows get no countdownA
failedrow keeps the last time it was scheduled for, so a countdown there would promise an attempt that never happens. Failed rows keep the marker's ownfailed: <reason>(the sanitized short reasonMessageDeliveryalready produces fromChatMessage.delivery), andsendingstays bare — both matching the TUI. The chat-levelN queuedfooter from t_f46a9863 is unchanged.The join is positional, and fail-closed
OutboxRow.message_idismessages.id, but the SDK'sChatMessagedoes not carry that id yet, so the join cannot be done on it from Kotlin.messages()isORDER BY m.idand the outbox holds one row per pending send, so the nth pending chat row owns the nth outbox row (sorted bymessageId). That is only allowed to speak when it can prove itself: mismatched counts, an unknown status, or a status contradicting the one the SDK resolved for that message drop every detail and fall back to the flat markers. Wrong numbers are worse than none.Adding
idtoChatMessagewould delete the positional assumption entirely; filed as a follow-up card for rust-dev.Evidence
./gradlew --no-daemon :app:assembleDebug :app:testDebugUnitTest-> BUILD SUCCESSFULOutboxDetailTest17,MessageDeliveryTest10,InviteAddFlowTest5).OutboxDetailTestcovers the threeretry_in_textbuckets (0/-45->retry now,1/45/59->Ns,60/61/600/1500/1800->Nm), the target wordingqueued (try 3/8, retry 45s),queued (try 3/12, ...)when the caller passes a different budget, that afailedrow yieldsnulldetail (no countdown) while its marker staysfailed: connection timed out, thatsendingis bare, and the three fail-closed cases (row-count mismatch, contradicting status, unknown status).44402cf6e896dabb3061fb5326e25d0528eccb79be508c1923c1c88a15967007, containslib/arm64-v8a/libonionwire_sdk.so.Bases — read before merging
feat/android-outbox-state, t_f46a9863) — the Android half of the #52/#56 duplicate pair. Do not merge #52; itsui/Delivery.ktis the older duplicate and would collide withui/MessageDelivery.kt.feat/sdk-outbox-rows), so its diff is android-only. Retarget tomainonce #51 -> #58 land.WireViewModel.ktstays a hotspot with open PR #49 (Tor lifecycle); the additions here are two passthrough functions.queued (try 3/8, retry 45s)from the SDK's outbox rows f2109a52b2Bases (read before merging)
feat/android-outbox-state(t_f46a9863) — the Android half of the #52/#56 duplicate pair. Do not merge #52: itsui/Delivery.ktis the older duplicate and collides withui/MessageDelivery.kt.mainonce #51 -> #58 land.WireViewModel.ktis a hotspot with open PR #49; the additions here are two passthrough functions.CI
No checks will appear on this PR:
.forgejo/workflows/ci.ymlallowlistssrc/**,crates/**,tests/**,Cargo.*— an android-only change cannot affect the Rust build, so the run is skipped by design rather than missing. The evidence for this change is local:f2109a52b2toe7976202d3e7976202d3toa2c632f162a2c632f162to20bfe7028820bfe70288toea27c1508eea27c1508eto0999601e6a