WPB-26101 move code from KeyPackage into subsystem and store - #5368
Merged
Conversation
battermann
marked this pull request as ready for review
July 23, 2026 13:51
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors MLS key-package persistence/claiming logic out of Brig’s service-local Brig.Data.MLS.KeyPackage module into reusable wire-subsystems components, separating the Cassandra access layer (“store”) from the higher-level orchestration (“subsystem”). This aligns key-package handling with the broader subsystem architecture used across the monorepo.
Changes:
- Moved MLS key-package business logic into a new
Wire.MlsKeyPackageSubsystemand its interpreter, and split Cassandra persistence intoWire.MlsKeyPackageStore+ Cassandra interpreter. - Updated Brig interpreters/effect stacks and API handlers to depend on the new subsystem/store effects instead of Brig-local data access.
- Removed the old Brig key-package data module and added a changelog entry documenting the extraction.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| services/brig/src/Brig/Data/MLS/KeyPackage.hs | Removed the previous Brig-local Cassandra + claim/count/delete implementation. |
| services/brig/src/Brig/CanonicalInterpreter.hs | Wired new MlsKeyPackageStore and MlsKeyPackageSubsystem interpreters into Brig’s interpreter stack. |
| services/brig/src/Brig/API/Public.hs | Added MlsKeyPackageSubsystem effect requirement to the public API effect constraints. |
| services/brig/src/Brig/API/MLS/KeyPackages/Validation.hs | Delegated lifetime validation to Wire.MlsKeyPackageSubsystem.validateKeyPackageLifetime. |
| services/brig/src/Brig/API/MLS/KeyPackages.hs | Switched key-package upload/claim/count/delete flows to use the new subsystem effect. |
| services/brig/src/Brig/API/Internal.hs | Updated internal MLS endpoints to use the new subsystem effect for key-package counting. |
| services/brig/src/Brig/API/Federation.hs | Updated federation MLS endpoints to require/use the new subsystem effect. |
| services/brig/brig.cabal | Dropped the removed Brig.Data.MLS.KeyPackage module from the Brig library. |
| libs/wire-subsystems/wire-subsystems.cabal | Added the new store/subsystem modules to wire-subsystems. |
| libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs | New subsystem interpreter implementing claim/count/cleanup logic over the store effect. |
| libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem.hs | New subsystem effect definition plus shared lifetime validation function. |
| libs/wire-subsystems/src/Wire/MlsKeyPackageStore/Cassandra.hs | New Cassandra interpreter for key-package persistence queries. |
| libs/wire-subsystems/src/Wire/MlsKeyPackageStore.hs | New store effect definition for key-package persistence operations. |
| changelog.d/5-internal/WPB-26101 | Changelog entry describing the extraction into subsystem + store. |
blackheaven
approved these changes
Jul 23, 2026
Co-authored-by: Gautier DI FOLCO <gautier.difolco@wire.com>
…er.hs Co-authored-by: Gautier DI FOLCO <gautier.difolco@wire.com>
Co-authored-by: Gautier DI FOLCO <gautier.difolco@wire.com>
Co-authored-by: Gautier DI FOLCO <gautier.difolco@wire.com>
Wire.UserSubsystem.Interpreter.UserSubsystem.Interpreter.SearchUsers exact handle matches are not duplicate
This was referenced Aug 21, 2026
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.
Checklist
changelog.d