Skip to content

refactor: replace group store with dedicated caches [WPB-22782]#2145

Merged
coriolinus merged 14 commits into
mainfrom
prgn/refactor/22782-improve-group-store
May 18, 2026
Merged

refactor: replace group store with dedicated caches [WPB-22782]#2145
coriolinus merged 14 commits into
mainfrom
prgn/refactor/22782-improve-group-store

Conversation

@coriolinus
Copy link
Copy Markdown
Contributor

What's new in this PR

Get rid of the whole group store module and its contents. These were meant to be reusable caches for conversation data to reduce DB accesses and deserialization costs, but we were trying to get too much flexibility out of them, leading to high complexity.

This PR replaces those with two independent purpose-built caches, one for Proteus and one for MLS.


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@coriolinus coriolinus changed the title refactor: improve group store [WPB-22782] refactor: replace group store with dedicated caches [WPB-22782] May 15, 2026
@coriolinus coriolinus marked this pull request as ready for review May 16, 2026 07:27
@coriolinus coriolinus requested a review from a team May 16, 2026 07:27
Comment thread crypto/src/proteus/conversation_session.rs
@coriolinus coriolinus force-pushed the prgn/refactor/22782-improve-group-store branch from ce4e179 to 42db2ca Compare May 18, 2026 13:08
Comment thread crypto-ffi/bindings/js/packages/browser/test/database.test.ts
Comment thread crypto-ffi/src/core_crypto_context/proteus.rs
@coriolinus coriolinus force-pushed the prgn/refactor/22782-improve-group-store branch from e88c7c2 to 401ac72 Compare May 18, 2026 13:36
Copy link
Copy Markdown
Member

@SimonThormeyer SimonThormeyer left a comment

Choose a reason for hiding this comment

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

This is great, but I'd like to see the breaking change explained (removal of proteusReloadSessions() in the book)

coriolinus and others added 14 commits May 18, 2026 16:09
Split the 848-line crypto/src/proteus.rs into crypto/src/proteus/ with
files grouped by concern (conversation_session, session, message, prekey,
core_crypto), co-locating tests with the code they exercise. Public API
unchanged: ProteusCentral, ProteusConversationSession, and SessionIdentifier
remain reachable at crate::proteus::* via mod.rs re-exports. Prerequisite
for the upcoming group_store refactor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
These accessors were never used and exposed implementation details.
This is much simpler than the old `GroupStore` stuff!
The group store is overly complicated for what we want from it.
So now that we have a dedicated proteus session store,
use that instead.

Note that unlike the group store, we no longer eagerly load
sessions into the cache. This is becuase eager loading only made
sense when it would load all the conversations; above that limit,
the selection loaded would be the oldest-established (sqlite) or
effectively random (indexeddb). Neither of those are "most used".
This is intended to replace the group store, which was
overly complicated for what we needed.
Didn't check interop when removing an API. But really we shouldn't
be publishing APIs only for interop anyway. So this just uses the
more normal API instead.
Proteus sessions now act the way MLS sessions do: they load dynamically
on first use with no preload. The `proteusReloadSessions` function has
therefore been removed.
This slipped through the cracks because we used to transparently create
a default GroupStoreValue for MLS conversations when one did not already
exist. The new implementation is stricter, which caused this test to fail.
This slipped through the cracks because we used to transparently create
a default GroupStoreValue for MLS conversations when one did not already
exist. The new implementation is stricter, which caused this test to fail.
@coriolinus coriolinus force-pushed the prgn/refactor/22782-improve-group-store branch from 505f9a0 to 775390c Compare May 18, 2026 14:09
@coriolinus coriolinus merged commit 775390c into main May 18, 2026
1 check passed
@coriolinus coriolinus deleted the prgn/refactor/22782-improve-group-store branch May 18, 2026 14:09
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.

3 participants