Skip to content

Commit

Permalink
chore(proteus): add logs for prekey generation (#2092) (#2095)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitor Hugo Schwaab <[email protected]>
  • Loading branch information
github-actions[bot] and vitorhugods authored Sep 26, 2023
1 parent 5343e2f commit 684669f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import com.wire.kalium.logic.feature.message.CryptoSessionMapper
import com.wire.kalium.logic.feature.message.CryptoSessionMapperImpl
import com.wire.kalium.logic.functional.Either
import com.wire.kalium.logic.functional.flatMap
import com.wire.kalium.logic.functional.onFailure
import com.wire.kalium.logic.functional.onSuccess
import com.wire.kalium.logic.kaliumLogger
import com.wire.kalium.logic.wrapApiRequest
import com.wire.kalium.logic.wrapProteusRequest
import com.wire.kalium.logic.wrapStorageRequest
Expand Down Expand Up @@ -151,7 +154,15 @@ class PreKeyDataSource(
firstKeyId: Int,
keysCount: Int
): Either<ProteusFailure, List<PreKeyCrypto>> =
wrapProteusRequest { proteusClientProvider.getOrCreate().newPreKeys(firstKeyId, keysCount) }
wrapProteusRequest { proteusClientProvider.getOrCreate().newPreKeys(firstKeyId, keysCount) }.onSuccess {
kaliumLogger.i(
"""Generating PreKeys: {"success":true,"firstKeyId":$firstKeyId,"$keysCount":$keysCount}"""
)
}.onFailure {
kaliumLogger.i(
"""Generating PreKeys: {"success":false,"firstKeyId":$firstKeyId, "$keysCount":$keysCount}"""
)
}

override suspend fun generateNewLastResortKey(): Either<ProteusFailure, PreKeyCrypto> =
wrapProteusRequest {
Expand Down

0 comments on commit 684669f

Please sign in to comment.