RefillKeyPackagesUseCase

internal interface RefillKeyPackagesUseCase

This use case will check if the number of key packages is below the minimum threshold and will upload new key packages if needed.

If no key packages were left, other clients could not add this client to new MLS groups. In that case pending MLS conversations are flagged to be joined by external commit, before uploading, so the flag survives a failed upload or a restart.

Each batch is generated in its own MLS transaction and uploaded only after it commits, so the backend never gets key packages whose private keys could still be rolled back. Don't call this from inside another crypto transaction.

Inheritors

Functions

Link copied to clipboard
abstract suspend operator fun invoke(): RefillKeyPackagesResult