fix(sdk): surface Sent/Queued on send(), and build the SDK in CI
Node::send() became Result<OutboxStatus, String> in the local-outbox work, which broke crates/onionwire-sdk — and nothing noticed, because the SDK is a separate cargo workspace that root CI never compiles. - Wire::send() returns WResult<SendState> (Sent | Queued) - ChatMessage.delivery for outgoing rows - New sdk job in ci.yml (own target volume; rustls workspace) - Refresh SDK Cargo.lock + README (SQLCipher / outbox facts) Rebased onto main after #50/#54: no src/node.rs changes (WAL checkpoint lives in Store now). README at-rest claims kept from #55.
This commit is contained in:
parent
997b554bf1
commit
e30c9f1699
5 changed files with 208 additions and 28 deletions
|
|
@ -18,8 +18,8 @@ onions directly. There is no `tor` binary, no torrc, no Orbot as the pipe.
|
|||
| Onion | A **locator**, not an identity. It rotates. |
|
||||
| Invite | `onionwire:v1:k=…:o=…:spk=…:sig=…` |
|
||||
| Crypto | Noise IK (`Noise_IK_25519_ChaChaPoly_BLAKE2s`). `spk` is x25519. |
|
||||
| Fail closed | Peer onion down → the send fails. No outbox, no spool in v1. |
|
||||
| At rest | Chat bodies encrypted (Argon2id wrap + ChaCha20-Poly1305). Identity keys in sqlite are plaintext — that is honest, not an oversight. |
|
||||
| Chat send | Unreachable peer onion → the message goes to the **local outbox** and is retried with backoff. `send()` returns `SendState.Sent` or `SendState.Queued`. File transfer and payments stay fail-closed. |
|
||||
| At rest | The whole sqlite file is SQLCipher (key = Argon2id of the store passphrase), and chat bodies carry a second per-row ChaCha20-Poly1305 layer with row-bound AAD. Identity keys live in that same encrypted file. |
|
||||
|
||||
### Invite string
|
||||
|
||||
|
|
@ -66,8 +66,10 @@ Requirements:
|
|||
|
||||
## Kotlin surface
|
||||
|
||||
Everything is a `suspend fun` — Arti bootstrap and onion publish take minutes,
|
||||
and a send retries the peer for up to 3 minutes before failing.
|
||||
Everything is a `suspend fun` — Arti bootstrap and onion publish take minutes.
|
||||
A send that cannot reach the peer comes back immediately as `QUEUED` (it is not
|
||||
a long retry inside the call): the message is stored locally and a background
|
||||
worker in the core keeps retrying it.
|
||||
|
||||
```kotlin
|
||||
import uniffi.onionwire_sdk.*
|
||||
|
|
@ -88,8 +90,16 @@ val friend: FriendInfo = wire.addFriend(pasted)
|
|||
// 4. Roster and chat.
|
||||
val roster: List<FriendInfo> = wire.friends()
|
||||
wire.setPetname(friend.pubkeyHex, "ada")
|
||||
wire.send(friend.pubkeyHex, "hello wire")
|
||||
when (wire.send(friend.pubkeyHex, "hello wire")) {
|
||||
SendState.SENT -> { /* the peer's onion took the frame */ }
|
||||
SendState.QUEUED -> { /* unreachable: stored in the local outbox and
|
||||
retried in the background. Show it as pending —
|
||||
it is local-only until a circuit takes it. */ }
|
||||
}
|
||||
val msgs: List<ChatMessage> = wire.messages(friend.pubkeyHex)
|
||||
// msgs[i].direction == "out" -> msgs[i].delivery is "sent" | "queued" |
|
||||
// "sending" | "failed: <reason>"; null for incoming messages. Render the
|
||||
// queued and failed states distinctly from sent.
|
||||
|
||||
// 5. Locator rotation. Do NOT wire this to a single tap — the app that embeds
|
||||
// the SDK owns the typed confirmation.
|
||||
|
|
|
|||
Loading…
Reference in a new issue