feat: durable MLS storage folded into a single ChatStore#158
Draft
osmaczko wants to merge 1 commit into
Draft
Conversation
8d86689 to
d025390
Compare
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.
d025390 to
7332c15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
the whole durable-storage contract (identity/ephemeral/conversation/ratchet
sub-stores plus the MLS key-value surface).
(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.
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.
vestigial store generic from ChatClient and the builder. Retire the stubbed
in-memory MemStore in favour of ChatStorage::in_memory().
MlsGroup::load path, proven by a drop-and-reload integration test.