From 684669fc4013a0ade4277523502a66928d1e6a6e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:44:12 +0200 Subject: [PATCH] chore(proteus): add logs for prekey generation (#2092) (#2095) Co-authored-by: Vitor Hugo Schwaab --- .../kalium/logic/data/prekey/PreKeyRepository.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt index 1fd223b46ad..5257de969ac 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt @@ -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 @@ -151,7 +154,15 @@ class PreKeyDataSource( firstKeyId: Int, keysCount: Int ): Either> = - 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 = wrapProteusRequest {