feat(sdk): ChatMessage.id — join a chat row to its outbox row #61

Merged
sirius merged 1 commit from wt/t_254f9025 into feat/sdk-outbox-rows 2026-09-12 23:09:07 +00:00
Owner

Adds the join key the Android client (t_f8658427 / PR #59) needs to stop pairing chat rows to outbox rows positionally.

Change

  • ChatMessage.id: i64 — first field, copied from the messages.id the core already selects (Store::list_messages). No other field changes.
  • The record mapping moved into a chat_message(m, status) helper, so Wire::messages and the test share one path.
  • New store-backed test a_chat_row_joins_to_its_outbox_row_by_message_id: real Store, one queued send, then asserts the id on the ChatMessage equals the message_id on the OutboxRow for that same row (and that the outbox side is the stored row id, not a default).

Base

Base is feat/sdk-outbox-rows (#58, head c6a586c), not main: OutboxRow / outbox_row() only exist there. Retarget once #58 merges.

Evidence

  • crates/onionwire-sdk: cargo test --locked — 7 lib tests + 2 integration tests, 0 failures (RED first: cannot find function chat_message).
  • crates/onionwire-sdk: cargo clippy --locked --all-targets -- -D warnings — clean.
  • Bindings: uniffi-bindgen generate --library libonionwire_sdk.so --language kotlin emits data class ChatMessage ( var id: kotlin.Long, ... ) — the AAR gains one constructor field.
  • Diff is crates/onionwire-sdk/src/lib.rs only (+87/-5).

Not here

Android follow-up (drop the positional join in OutboxDetail.kt::outboxDetails, match on messageId) stays with card t_f8658427 / PR #59.

Adds the join key the Android client (t_f8658427 / PR #59) needs to stop pairing chat rows to outbox rows positionally. ### Change - `ChatMessage.id: i64` — first field, copied from the `messages.id` the core already selects (`Store::list_messages`). No other field changes. - The record mapping moved into a `chat_message(m, status)` helper, so `Wire::messages` and the test share one path. - New store-backed test `a_chat_row_joins_to_its_outbox_row_by_message_id`: real `Store`, one queued send, then asserts the `id` on the `ChatMessage` equals the `message_id` on the `OutboxRow` for that same row (and that the outbox side is the stored row id, not a default). ### Base Base is `feat/sdk-outbox-rows` (#58, head c6a586c), **not** `main`: `OutboxRow` / `outbox_row()` only exist there. Retarget once #58 merges. ### Evidence - `crates/onionwire-sdk`: `cargo test --locked` — 7 lib tests + 2 integration tests, 0 failures (RED first: `cannot find function chat_message`). - `crates/onionwire-sdk`: `cargo clippy --locked --all-targets -- -D warnings` — clean. - Bindings: `uniffi-bindgen generate --library libonionwire_sdk.so --language kotlin` emits `data class ChatMessage ( var id: kotlin.Long, ... )` — the AAR gains one constructor field. - Diff is `crates/onionwire-sdk/src/lib.rs` only (+87/-5). ### Not here Android follow-up (drop the positional join in `OutboxDetail.kt::outboxDetails`, match on `messageId`) stays with card `t_f8658427` / PR #59.
feat(sdk): ChatMessage.id — join a chat row to its outbox row
All checks were successful
ci / test (pull_request) Successful in 3m4s
ci / sdk (pull_request) Successful in 58s
109f64905f
`OutboxRow::message_id` documents itself as *the* join key (the
`messages.id` a `ChatMessage` belongs to), but the record carried no id,
so the Android client could only pair the two lists positionally.

Add `ChatMessage.id: i64` as the first field, copied straight from the
`messages.id` the store already selects. Additive over UniFFI: Kotlin
consumers only gain a constructor field and the bindings regenerate.

The id mapping moves into a `chat_message` helper so the join property is
testable without a Node: the new test builds a real store, queues an
outbox row for a message, and asserts the id on the message equals the
`message_id` the outbox row reports for that same row.
sirius force-pushed wt/t_254f9025 from 109f64905f
All checks were successful
ci / test (pull_request) Successful in 3m4s
ci / sdk (pull_request) Successful in 58s
to 26afbc1197
All checks were successful
ci / test (pull_request) Successful in 3m3s
ci / sdk (pull_request) Successful in 56s
2026-09-12 21:11:12 +00:00
Compare
sirius force-pushed wt/t_254f9025 from 26afbc1197
All checks were successful
ci / test (pull_request) Successful in 3m3s
ci / sdk (pull_request) Successful in 56s
to 758baef3e6
All checks were successful
ci / test (pull_request) Successful in 3m0s
ci / sdk (pull_request) Successful in 56s
2026-09-12 21:12:07 +00:00
Compare
sirius force-pushed wt/t_254f9025 from 758baef3e6
All checks were successful
ci / test (pull_request) Successful in 3m0s
ci / sdk (pull_request) Successful in 56s
to 19f2c693f6
All checks were successful
ci / test (pull_request) Successful in 3m0s
ci / sdk (pull_request) Successful in 51s
2026-09-12 21:15:47 +00:00
Compare
sirius force-pushed wt/t_254f9025 from 19f2c693f6
All checks were successful
ci / test (pull_request) Successful in 3m0s
ci / sdk (pull_request) Successful in 51s
to 938232d690
All checks were successful
ci / test (pull_request) Successful in 3m58s
ci / sdk (pull_request) Successful in 1m3s
2026-09-12 21:18:20 +00:00
Compare
sirius force-pushed wt/t_254f9025 from 938232d690
All checks were successful
ci / test (pull_request) Successful in 3m58s
ci / sdk (pull_request) Successful in 1m3s
to c969e60185
All checks were successful
ci / test (pull_request) Successful in 3m52s
ci / sdk (pull_request) Successful in 59s
2026-09-12 22:15:16 +00:00
Compare
sirius merged commit febc963421 into feat/sdk-outbox-rows 2026-09-12 23:09:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!61
No description provided.