diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt index eba20f7fbe..1054f11c94 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt @@ -136,19 +136,14 @@ interface UserConfigRepository { suspend fun setShouldNotifyForRevokedCertificate(shouldNotify: Boolean) suspend fun observeShouldNotifyForRevokedCertificate(): Flow> suspend fun clearE2EISettings() -<<<<<<< HEAD - fun setShouldFetchE2EITrustAnchors(shouldFetch: Boolean) - fun getShouldFetchE2EITrustAnchor(): Boolean suspend fun setCurrentTrackingIdentifier(newIdentifier: String) suspend fun getCurrentTrackingIdentifier(): String? suspend fun observeCurrentTrackingIdentifier(): Flow> suspend fun setPreviousTrackingIdentifier(identifier: String) suspend fun getPreviousTrackingIdentifier(): String? suspend fun deletePreviousTrackingIdentifier() -======= suspend fun setShouldFetchE2EITrustAnchors(shouldFetch: Boolean) suspend fun getShouldFetchE2EITrustAnchor(): Boolean ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) } @Suppress("TooManyFunctions") @@ -515,9 +510,6 @@ internal class UserConfigDataSource internal constructor( userConfigDAO.setShouldFetchE2EITrustAnchors(shouldFetch = shouldFetch) } -<<<<<<< HEAD - override fun getShouldFetchE2EITrustAnchor(): Boolean = userConfigStorage.getShouldFetchE2EITrustAnchorHasRun() - override suspend fun setCurrentTrackingIdentifier(newIdentifier: String) { wrapStorageRequest { userConfigDAO.setTrackingIdentifier(identifier = newIdentifier) @@ -544,7 +536,5 @@ internal class UserConfigDataSource internal constructor( userConfigDAO.deletePreviousTrackingIdentifier() } } -======= override suspend fun getShouldFetchE2EITrustAnchor(): Boolean = userConfigDAO.getShouldFetchE2EITrustAnchorHasRun() ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt index 635711376d..9b2a097ddc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt @@ -143,12 +143,8 @@ class RegisterClientUseCaseImpl @OptIn(DelicateKaliumApi::class) internal constr clientType, model, cookieLabel, -<<<<<<< HEAD verificationCode, - modelPostfix -======= - verificationCode ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) + modelPostfix, ) }.fold({ RegisterClientResult.Failure.Generic(it) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt index 3b389a2623..8601cd4988 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt @@ -914,7 +914,7 @@ class E2EIRepositoryTest { arrangement.coreCryptoCentral.registerTrustAnchors(eq(Arrangement.RANDOM_BYTE_ARRAY.decodeToString())) }.wasInvoked(once) - verify { + coVerify { arrangement.userConfigRepository.setShouldFetchE2EITrustAnchors(eq(false)) }.wasInvoked(once) } @@ -933,15 +933,9 @@ class E2EIRepositoryTest { // then result.shouldSucceed() -<<<<<<< HEAD - verify { + coVerify { arrangement.userConfigRepository.getShouldFetchE2EITrustAnchor() }.wasInvoked(once) -======= - verify(arrangement.userConfigRepository) - .suspendFunction(arrangement.userConfigRepository::getShouldFetchE2EITrustAnchor) - .wasInvoked(once) ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) } @Test @@ -1105,31 +1099,18 @@ class E2EIRepositoryTest { }.returns(result) } - fun withGetShouldFetchE2EITrustAnchors(result: Boolean) = apply { -<<<<<<< HEAD - every { + suspend fun withGetShouldFetchE2EITrustAnchors(result: Boolean) = apply { + coEvery { userConfigRepository.getShouldFetchE2EITrustAnchor() }.returns(result) } - fun withSetShouldFetchE2EIGetTrustAnchors() = apply { - every { + suspend fun withSetShouldFetchE2EIGetTrustAnchors() = apply { + coEvery { userConfigRepository.setShouldFetchE2EITrustAnchors(any()) }.returns(Unit) -======= - given(userConfigRepository) - .suspendFunction(userConfigRepository::getShouldFetchE2EITrustAnchor) - .whenInvoked() - .thenReturn(result) } - fun withSetShouldFetchE2EIGetTrustAnchors() = apply { - given(userConfigRepository) - .suspendFunction(userConfigRepository::setShouldFetchE2EITrustAnchors) - .whenInvokedWith(any()) - .thenReturn(Unit) ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) - } suspend fun withAcmeDirectoriesApiSucceed() = apply { coEvery { diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt index 490ed17db7..7ecb757c2d 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt @@ -60,17 +60,14 @@ interface UserConfigDAO { suspend fun observeShouldNotifyForRevokedCertificate(): Flow suspend fun setDefaultCipherSuite(cipherSuite: SupportedCipherSuiteEntity) suspend fun getDefaultCipherSuite(): SupportedCipherSuiteEntity? -<<<<<<< HEAD suspend fun setTrackingIdentifier(identifier: String) suspend fun getTrackingIdentifier(): String? suspend fun observeTrackingIdentifier(): Flow suspend fun setPreviousTrackingIdentifier(identifier: String) suspend fun getPreviousTrackingIdentifier(): String? suspend fun deletePreviousTrackingIdentifier() -======= suspend fun setShouldFetchE2EITrustAnchors(shouldFetch: Boolean) suspend fun getShouldFetchE2EITrustAnchorHasRun(): Boolean ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) } @Suppress("TooManyFunctions") @@ -197,7 +194,6 @@ internal class UserConfigDAOImpl internal constructor( override suspend fun getDefaultCipherSuite(): SupportedCipherSuiteEntity? = metadataDAO.getSerializable(DEFAULT_CIPHER_SUITE_KEY, SupportedCipherSuiteEntity.serializer()) -<<<<<<< HEAD override suspend fun setTrackingIdentifier(identifier: String) { metadataDAO.insertValue( key = ANALYTICS_TRACKING_IDENTIFIER_KEY, @@ -224,14 +220,13 @@ internal class UserConfigDAOImpl internal constructor( override suspend fun deletePreviousTrackingIdentifier() { metadataDAO.deleteValue(key = ANALYTICS_TRACKING_IDENTIFIER_PREVIOUS_KEY) } -======= + override suspend fun setShouldFetchE2EITrustAnchors(shouldFetch: Boolean) { metadataDAO.insertValue(value = shouldFetch.toString(), key = SHOULD_FETCH_E2EI_GET_TRUST_ANCHORS) } override suspend fun getShouldFetchE2EITrustAnchorHasRun(): Boolean = metadataDAO.valueByKey(SHOULD_FETCH_E2EI_GET_TRUST_ANCHORS)?.toBoolean() ?: true ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) private companion object { private const val DEFAULT_CIPHER_SUITE_KEY = "DEFAULT_CIPHER_SUITE" @@ -243,11 +238,8 @@ internal class UserConfigDAOImpl internal constructor( const val LEGAL_HOLD_CHANGE_NOTIFIED = "legal_hold_change_notified" const val SHOULD_UPDATE_CLIENT_LEGAL_HOLD_CAPABILITY = "should_update_client_legal_hold_capability" -<<<<<<< HEAD private const val ANALYTICS_TRACKING_IDENTIFIER_PREVIOUS_KEY = "analytics_tracking_identifier_previous" private const val ANALYTICS_TRACKING_IDENTIFIER_KEY = "analytics_tracking_identifier" -======= const val SHOULD_FETCH_E2EI_GET_TRUST_ANCHORS = "should_fetch_e2ei_trust_anchors" ->>>>>>> bea029d86e (fix: crash when login after session expire and client deleted remotely [WPB-11061] (#3031)) } }