Skip to content

WPB-26101 move code from KeyPackage into subsystem and store - #5368

Merged
battermann merged 9 commits into
developfrom
WPB-26101-prep-subsystem-refactoring
Jul 24, 2026
Merged

WPB-26101 move code from KeyPackage into subsystem and store#5368
battermann merged 9 commits into
developfrom
WPB-26101-prep-subsystem-refactoring

Conversation

@battermann

@battermann battermann commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@battermann
battermann marked this pull request as ready for review July 23, 2026 13:51
@battermann
battermann requested review from a team as code owners July 23, 2026 13:51
@battermann
battermann requested a review from Copilot July 23, 2026 13:51
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jul 23, 2026

Copilot AI 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.

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.MlsKeyPackageSubsystem and its interpreter, and split Cassandra persistence into Wire.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.

Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem.hs
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageStore/Cassandra.hs
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageStore.hs
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageStore.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem/Interpreter.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageStore/Cassandra.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/MlsKeyPackageSubsystem.hs Outdated
battermann and others added 5 commits July 24, 2026 09:07
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
@battermann
battermann merged commit 539fca7 into develop Jul 24, 2026
9 checks passed
@battermann
battermann deleted the WPB-26101-prep-subsystem-refactoring branch July 24, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants