Skip to content

ChatClient migration#145

Merged
jazzz merged 8 commits into
mainfrom
jazzz/client_migration
Jun 23, 2026
Merged

ChatClient migration#145
jazzz merged 8 commits into
mainfrom
jazzz/client_migration

Conversation

@jazzz

@jazzz jazzz commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This PR continue preparing Cli-Client for group chats. Specifically It introduces a Builder pattern which allows clients to be constructed with both testing and production components.

Relating to De-MLS, this PR:

  • Allow Clients to accept any IdentityProvider to support DelegateSigners.
  • Removes reliance on legacy settings.
  • Chooses a default implementation for each service.

Summary

  • Introduces ChatClientBuilder, a typestate builder for constructing ChatClient that makes all four configuration slots (identity, transport, registration, storage) explicit at the type level, with sensible defaults for any unset field
  • Promotes ChatClient from a 2-param <T, R> type to a fully generic <I, T, R, S> type, making the identity provider and storage backend first-class type parameters; removes the old open / open_with_registry constructors in favour of the builder
  • Adds storage_config() on the builder as a convenience that accepts a StorageConfig and constructs ChatStorage inline, so callers don't need to import ChatStorage directly
  • Fixes re-entrant message filtering in GroupV1Convo: echoed outbound messages (including MLS Commits from add_member) are now suppressed via a bounded hash cache (OUTBOUND_HASH_CACHE_SIZE = 25) to prevent the sender from re-processing its own messages on loopback transports
  • Re-exports ChatStorage, ChatStore, and IdentityProvider from logos-chat so downstream crates don't need to reach into internal dependencies
  • Updates chat-cli (app.rs, ui.rs, main.rs) and the message-exchange example to use the new 4-param ChatApp<I, T, R, S> and builder API

@jazzz jazzz force-pushed the jazzz/client_migration branch from 87044f0 to af92d09 Compare June 22, 2026 23:55
@jazzz jazzz changed the title Jazzz/client migration ChatClient migration Jun 23, 2026
@jazzz jazzz requested review from kaichaosun and osmaczko and removed request for osmaczko June 23, 2026 16:55

@osmaczko osmaczko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the builder pattern 👷‍♂️

@jazzz jazzz force-pushed the jazzz/client_migration branch from b1f2e2f to 42bdfa8 Compare June 23, 2026 17:32
@jazzz jazzz merged commit a5abefa into main Jun 23, 2026
5 checks passed
@jazzz jazzz deleted the jazzz/client_migration branch June 23, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants