Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara committed Sep 25, 2024
1 parent 8183680 commit f4f821e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,14 @@ interface UserConfigRepository {
suspend fun setShouldNotifyForRevokedCertificate(shouldNotify: Boolean)
suspend fun observeShouldNotifyForRevokedCertificate(): Flow<Either<StorageFailure, Boolean>>
suspend fun clearE2EISettings()
<<<<<<< HEAD
fun setShouldFetchE2EITrustAnchors(shouldFetch: Boolean)
fun getShouldFetchE2EITrustAnchor(): Boolean
suspend fun setCurrentTrackingIdentifier(newIdentifier: String)
suspend fun getCurrentTrackingIdentifier(): String?
suspend fun observeCurrentTrackingIdentifier(): Flow<Either<StorageFailure, String>>
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")
Expand Down Expand Up @@ -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)
Expand All @@ -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))
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,14 @@ interface UserConfigDAO {
suspend fun observeShouldNotifyForRevokedCertificate(): Flow<Boolean?>
suspend fun setDefaultCipherSuite(cipherSuite: SupportedCipherSuiteEntity)
suspend fun getDefaultCipherSuite(): SupportedCipherSuiteEntity?
<<<<<<< HEAD
suspend fun setTrackingIdentifier(identifier: String)
suspend fun getTrackingIdentifier(): String?
suspend fun observeTrackingIdentifier(): Flow<String?>
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")
Expand Down Expand Up @@ -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,
Expand All @@ -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"
Expand All @@ -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))
}
}

0 comments on commit f4f821e

Please sign in to comment.