osmaczko 7332c152c0
feat: durable MLS storage folded into a single ChatStore
Implements issue #112: MLS group state must survive process restarts. The MLS
provider hardcoded an in-memory store separate from the chat store, so a restart
lost every group. Fold the OpenMLS StorageProvider into libchat's own ChatStore
so one durable store holds both chat state and MLS group state.

- storage: ChatStore subsumes StorageProvider<CURRENT_VERSION>, so a ChatStore is
  the whole durable-storage contract (identity/ephemeral/conversation/ratchet
  sub-stores plus the MLS key-value surface).
- chat-sqlite: ChatStorage implements StorageProvider over an mls_kv table
  (migration 003_mls_storage), a byte-faithful port of MemoryStorage with decode
  errors surfaced instead of unwrapped and the reference clear_proposal_queue
  orphan-key bug fixed. The separate SqliteMlsStorage type is removed.
- conversations: MlsPqProvider becomes a transient view borrowing the shared
  store and a long-lived crypto backend, so the store stays singly owned;
  ServiceContext hands it out via mls_provider(). ExternalServices drops its ST
  associated type, leaving one CS. GroupV2/de_mls's thread-safe-error bound is
  restated on CS because an associated-type bound does not elaborate through a
  supertrait.
- client: the store is always ChatStorage, so fix it as such and drop the
  vestigial store generic from ChatClient and the builder. Retire the stubbed
  in-memory MemStore in favour of ChatStorage::in_memory().
- GroupV1 conversations resume across a restart through the existing
  MlsGroup::load path, proven by a drop-and-reload integration test.
2026-07-01 19:55:02 +02:00
2026-06-26 10:05:28 -07:00
2026-01-30 15:46:36 +00:00

libchat

Supporting library for Logos-chat

Example app

bin/chat-cli is an end-to-end encrypted CLI chat app built on this library. By default it uses logos-delivery (Waku-based) as the transport so two users anywhere in the world can chat by sharing an intro bundle. A local file transport is also bundled in; pick at runtime with --transport <logos-delivery|file>.

# Build logos-delivery with Nix
nix build .#logos-delivery
# Build chat-cli with Cargo
LOGOS_DELIVERY_LIB_DIR=./result/lib cargo build --release -p chat-cli
# Run binary (defaults to --transport logos-delivery)
./target/release/chat-cli --name alice

See bin/chat-cli/README.md for full build, run, and test instructions.

Description
Supporting library for Logos-chat
Readme
Languages
Rust 99.5%
Nix 0.5%