Skip to content

Commit

Permalink
chore(refactor): add global db in memory support (WPB-8989) (#2747)
Browse files Browse the repository at this point in the history
* chore: in memory global db

* fix: configure opening mode to nomutex

* fix: journaling and tx mode

* chore: remove debugging code

* chore: running dockermode with default sequential warmup and more comments

* chore: wip, extracting driver builder

* chore: fix for apple platforms

* refactor: unify creation of database pattern for globaldb

* refactor: wrapping up

* refactor: detekt

* chore: add missing platform code migration

* chore: rename

* chore: fix persistence-test

* chore: fix persistence-test

* chore(refactor): add global db in memory support - driver builder 2/2 (WPB-8989) (#2751)

* chore: pr comments

* chore: pr comments

* chore: align more pr comments

* chore: align more pr comments

* chore: detekt
  • Loading branch information
yamilmedina authored May 10, 2024
1 parent 7bb00da commit dd7669e
Show file tree
Hide file tree
Showing 51 changed files with 732 additions and 498 deletions.
8 changes: 6 additions & 2 deletions detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@
<ID>MatchingDeclarationName:ConversationStatus.kt$MutedConversationStatus</ID>
<ID>MatchingDeclarationName:CryptoboxCRUDStore.module_@wireapp_cryptobox.kt$CryptoboxCRUDStore : PreKeyStore</ID>
<ID>MatchingDeclarationName:CryptoboxSession.module_@wireapp_cryptobox.kt$CryptoboxSession</ID>
<ID>MatchingDeclarationName:DriverBuilder.android.kt$DriverBuilder</ID>
<ID>MatchingDeclarationName:DriverBuilder.apple.kt$DriverBuilder</ID>
<ID>MatchingDeclarationName:DriverBuilder.js.kt$DriverBuilder</ID>
<ID>MatchingDeclarationName:DriverBuilder.jvm.kt$DriverBuilder</ID>
<ID>MatchingDeclarationName:Encoder.module_@wireapp_cbor.kt$Encoder</ID>
<ID>MatchingDeclarationName:FileUtilTest.kt$FileTestHelper</ID>
<ID>MatchingDeclarationName:GetOtherUserClientsUseCaseTest.kt$ObserveClientsByUserIdUseCaseTest</ID>
Expand Down Expand Up @@ -487,6 +491,7 @@
<ID>MaximumLineLength:TypingIndicatorHandlerTest.kt$TypingIndicatorHandlerTest$ </ID>
<ID>MaximumLineLength:UserEventReceiverTest.kt$UserEventReceiverTest$ </ID>
<ID>MayBeConst:ACMEActions.kt$ACMEActions$/** * URL Paths */ private val ACME_BASE_URL = "https://balderdash.hogwash.work:9000/acme/google-android/"</ID>
<ID>MayBeConst:CallDAOTest.kt$CallDAOTest.Companion$val callId = "callId"</ID>
<ID>MayBeConst:CommonDokkaConfig.kt$private val DOKKA_CACHE_DIR = ".cache/dokka"</ID>
<ID>MayBeConst:ConversationDAOTest.kt$ConversationDAOTest.Companion$val messageTimer = 5000L</ID>
<ID>MayBeConst:E2EIClientTest.kt$E2EIClientTest.Companion$val ACCESS_TOKEN_RESPONSE = """ { "expires_in":"300", "token":"eyJhbGciOiJFZERTQSIsInR5cCI6ImF0K2p3dCIsImp3ayI6eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImdxTk8wZ1FzRndfUUNQNm5xeV9BUWxNVDFQSTAtZ3lRMWZTMGhJZklyTWcifX0.eyJpYXQiOjE2ODM0NjgwODIsImV4cCI6MTY5MTI0NDA4MiwibmJmIjoxNjgzNDY4MDgyLCJpc3MiOiJodHRwczovL3N0YWdpbmcuemluZnJhLmlvL2NsaWVudHMvNGVlZGJmZTE2ZDI1YmJmMy9hY2Nlc3MtdG9rZW4iLCJzdWIiOiJpbTp3aXJlYXBwPVpURTFNamMwTXpFeU5EUTBOR0poWTJFMU5XWm1OakEyWlRrMU1qSXlNek0vNGVlZGJmZTE2ZDI1YmJmM0BzdGFnaW5nLnppbmZyYS5pbyIsImF1ZCI6Imh0dHBzOi8vc3RhZ2luZy56aW5mcmEuaW8vY2xpZW50cy80ZWVkYmZlMTZkMjViYmYzL2FjY2Vzcy10b2tlbiIsImp0aSI6ImM3ZjRhODAxLTVhZTUtNDNlOC04ZGJiLWRiYjE1ZmEwODM1ZSIsIm5vbmNlIjoiaEJWWTdjRjNSWC1lSnF0cW9nbVl0dyIsImNoYWwiOiJMeGpJNVBUeVZ2UU56ZW9yUWNPUm44OURtR1BaZEc3SyIsImNuZiI6eyJraWQiOiI3YXR6MldkcGxwSzNhbmtKVmp6cm1telVEZmdhNkFTMjRCRm1VbEJ2V1lFIn0sInByb29mIjoiZXlKaGJHY2lPaUpGWkVSVFFTSXNJblI1Y0NJNkltUndiM0FyYW5kMElpd2lhbmRySWpwN0ltdDBlU0k2SWs5TFVDSXNJbU55ZGlJNklrVmtNalUxTVRraUxDSjRJam9pVVZkUldrTklRemxSVFhOaVFtWk5SbmRrTmpONlZtNTFVbFZNVVVKSU1sVnNaRGh5WDBWTFNtSXlTU0o5ZlEuZXlKcFlYUWlPakUyT0RNME5qZ3dOemtzSW1WNGNDSTZNVFk0TXpRMk9ERXdPU3dpYm1KbUlqb3hOamd6TkRZNE1EYzVMQ0p6ZFdJaU9pSnBiVHAzYVhKbFlYQndQVnBVUlRGTmFtTXdUWHBGZVU1RVVUQk9SMHBvV1RKRk1VNVhXbTFPYWtFeVdsUnJNVTFxU1hsTmVrMHZOR1ZsWkdKbVpURTJaREkxWW1KbU0wQnpkR0ZuYVc1bkxucHBibVp5WVM1cGJ5SXNJbXAwYVNJNkltSmlOek5qTVdJekxUZ3dNMlF0TkRVMFlTMDROakl5TFdNellqUXlORFpoTTJZME9TSXNJbTV2Ym1ObElqb2lhRUpXV1RkalJqTlNXQzFsU25GMGNXOW5iVmwwZHlJc0ltaDBiU0k2SWxCUFUxUWlMQ0pvZEhVaU9pSm9kSFJ3Y3pvdkwzTjBZV2RwYm1jdWVtbHVabkpoTG1sdkwyTnNhV1Z1ZEhNdk5HVmxaR0ptWlRFMlpESTFZbUptTXk5aFkyTmxjM010ZEc5clpXNGlMQ0pqYUdGc0lqb2lUSGhxU1RWUVZIbFdkbEZPZW1WdmNsRmpUMUp1T0RsRWJVZFFXbVJITjBzaWZRLkl1YjJqTkRXY1lKdTZ0V1liX181UlNSSEhQQWV1ZmwwRkRPQzc3STY4UDZtcG96QjMxeGtmUEZUb2p3ckJtSEhLZHFLOWdJTTQ5YWcxb2pTclNlZkNnIiwiY2xpZW50X2lkIjoiaW06d2lyZWFwcD1aVEUxTWpjME16RXlORFEwTkdKaFkyRTFOV1ptTmpBMlpUazFNakl5TXpNLzRlZWRiZmUxNmQyNWJiZjNAc3RhZ2luZy56aW5mcmEuaW8iLCJhcGlfdmVyc2lvbiI6Mywic2NvcGUiOiJ3aXJlX2NsaWVudF9pZCJ9.kFoRHJotAJQTgLXXrH4m9ySutFJb2cc4Raa1nbOyRxNTFZyQuwbJT1jGAlIbziQmVEIZ5vneOg0TqBAyEtw3BQ", "type":"DPoP" }"""</ID>
Expand Down Expand Up @@ -571,7 +576,6 @@
<ID>NoConsecutiveBlankLines:VerifyExistingClientUseCaseTest.kt$ </ID>
<ID>NoMultipleSpaces:CommonDokkaConfig.kt$ </ID>
<ID>NoMultipleSpaces:ConversationGroupRepositoryTest.kt$ConversationGroupRepositoryTest$ </ID>
<ID>NoMultipleSpaces:GlobalDBBaseTest.kt$GlobalDBBaseTest$ </ID>
<ID>NoMultipleSpaces:HttpClientConnectionSpecsTest.kt$HttpClientConnectionSpecsTest$ </ID>
<ID>NoMultipleSpaces:IgnoreIOS.kt$IgnoreIOS$ </ID>
<ID>NoMultipleSpaces:LegalHoldHandlerTest.kt$LegalHoldHandlerTest$ </ID>
Expand Down Expand Up @@ -935,7 +939,7 @@
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(libs.apacheTika) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(libs.coroutines.core) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(libs.ktor.okHttp) implementation(libs.okhttp.loggingInterceptor) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(libs.sqldelight.jvmDriver) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(libs.sqldelight.jvmDriver) implementation(libs.sqlite.xerialDriver) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmMain by getting { dependencies { implementation(project(":logic")) implementation(project(":calling")) } }</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmTest by getting</ID>
<ID>UnusedPrivateProperty:build.gradle.kts$val jvmTest by getting { dependencies { implementation(libs.konsist) } }</ID>
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ dagCommand = "1.9.0"
benchmark = "0.4.10"
jmh = "1.37"
jmhReport = "0.9.6"
xerialDriver = "3.45.3.0"

[plugins]
# Home-made convention plugins
Expand Down Expand Up @@ -187,6 +188,7 @@ sqldelight-r2dbc = { module = "app.cash.sqldelight:r2dbc-driver", version.ref =
sqldelight-async = { module = "app.cash.sqldelight:async-extensions", version.ref = "sqldelight" }
r2dbc-postgres = { module = "org.postgresql:r2dbc-postgresql", version.ref = "postgres" }
r2dbc-spi = { module = "io.r2dbc:r2dbc-spi", version.ref = "r2dbc" }
sqlite-xerialDriver = { module = "org.xerial:sqlite-jdbc", version.ref = "xerialDriver" }

# mocks and testing
mockative-runtime = { module = "io.mockative:mockative", version.ref = "mockative" }
Expand Down
20 changes: 14 additions & 6 deletions logic/src/androidMain/kotlin/com/wire/kalium/logic/CoreLogic.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ import com.wire.kalium.logic.sync.GlobalWorkSchedulerImpl
import com.wire.kalium.logic.util.PlatformContext
import com.wire.kalium.logic.util.SecurityHelperImpl
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.db.PlatformDatabaseData
import com.wire.kalium.persistence.db.globalDatabaseProvider
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider
import com.wire.kalium.util.KaliumDispatcherImpl
import kotlinx.coroutines.cancel

/**
Expand All @@ -51,10 +54,15 @@ actual class CoreLogic(
kaliumConfigs.shouldEncryptData
)

override val globalDatabase: GlobalDatabaseProvider = GlobalDatabaseProvider(
appContext,
SecurityHelperImpl(globalPreferences.passphraseStorage).globalDBSecret(),
kaliumConfigs.shouldEncryptData
override val globalDatabaseBuilder: GlobalDatabaseBuilder = globalDatabaseProvider(
platformDatabaseData = PlatformDatabaseData(appContext),
queriesContext = KaliumDispatcherImpl.io,
passphrase = if (kaliumConfigs.shouldEncryptData) {
SecurityHelperImpl(globalPreferences.passphraseStorage).globalDBSecret()
} else {
null
},
enableWAL = true
)

override fun getSessionScope(userId: UserId): UserSessionScope =
Expand Down Expand Up @@ -83,7 +91,7 @@ actual class CoreLogic(
rootPathsProvider,
appContext,
getGlobalScope(),
globalDatabase,
globalDatabaseBuilder,
kaliumConfigs,
globalPreferences,
globalCallManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.logic.sync.UserSessionWorkScheduler
import com.wire.kalium.logic.util.SecurityHelperImpl
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider

@Suppress("LongParameterList")
Expand All @@ -44,7 +44,7 @@ internal fun UserSessionScope(
userAgent: String,
userId: UserId,
globalScope: GlobalKaliumScope,
globalDatabaseProvider: GlobalDatabaseProvider,
globalDatabaseBuilder: GlobalDatabaseBuilder,
globalCallManager: GlobalCallManager,
globalPreferences: GlobalPrefProvider,
authenticationScopeProvider: AuthenticationScopeProvider,
Expand All @@ -67,7 +67,7 @@ internal fun UserSessionScope(
userId,
globalScope,
globalCallManager,
globalDatabaseProvider,
globalDatabaseBuilder,
globalPreferences,
authenticationScopeProvider,
userSessionWorkScheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.wire.kalium.logic.feature.call.GlobalCallManager
import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.logic.sync.UserSessionWorkSchedulerImpl
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider
import com.wire.kalium.persistence.util.FileNameUtil

Expand All @@ -45,7 +45,7 @@ internal actual class UserSessionScopeProviderImpl(
private val rootPathsProvider: RootPathsProvider,
private val appContext: Context,
private val globalScope: GlobalKaliumScope,
private val globalDatabaseProvider: GlobalDatabaseProvider,
private val globalDatabaseBuilder: GlobalDatabaseBuilder,
private val kaliumConfigs: KaliumConfigs,
private val globalPreferences: GlobalPrefProvider,
private val globalCallManager: GlobalCallManager,
Expand All @@ -69,7 +69,7 @@ internal actual class UserSessionScopeProviderImpl(
globalScope = globalScope,
globalCallManager = globalCallManager,
globalPreferences = globalPreferences,
globalDatabaseProvider = globalDatabaseProvider,
globalDatabaseBuilder = globalDatabaseBuilder,
authenticationScopeProvider = authenticationScopeProvider,
userSessionWorkScheduler = userSessionWorkScheduler,
rootPathsProvider = rootPathsProvider,
Expand Down
32 changes: 22 additions & 10 deletions logic/src/appleMain/kotlin/com/wire/kalium/logic/CoreLogic.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ import com.wire.kalium.logic.feature.UserSessionScopeProvider
import com.wire.kalium.logic.feature.UserSessionScopeProviderImpl
import com.wire.kalium.logic.feature.call.GlobalCallManager
import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.logic.network.NetworkStateObserverImpl
import com.wire.kalium.logic.sync.GlobalWorkScheduler
import com.wire.kalium.logic.sync.GlobalWorkSchedulerImpl
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.db.PlatformDatabaseData
import com.wire.kalium.persistence.db.StorageData
import com.wire.kalium.persistence.db.globalDatabaseProvider
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider
import com.wire.kalium.util.KaliumDispatcherImpl
import kotlinx.coroutines.cancel

actual class CoreLogic(
rootPath: String,
kaliumConfigs: KaliumConfigs,
userAgent: String
userAgent: String,
useInMemoryStorage: Boolean = false,
) : CoreLogicCommon(
rootPath = rootPath, kaliumConfigs = kaliumConfigs, userAgent = userAgent
) {
Expand All @@ -45,8 +50,17 @@ actual class CoreLogic(
shouldEncryptData = kaliumConfigs.shouldEncryptData
)

override val globalDatabase: GlobalDatabaseProvider =
GlobalDatabaseProvider("$rootPath/global-storage")
override val globalDatabaseBuilder: GlobalDatabaseBuilder = globalDatabaseProvider(
platformDatabaseData = PlatformDatabaseData(
storageData = if (useInMemoryStorage) {
StorageData.InMemory
} else {
StorageData.FileBacked("$rootPath/global-storage")
}
),
queriesContext = KaliumDispatcherImpl.io,
passphrase = null
)

override val networkStateObserver: NetworkStateObserver = NetworkStateObserverImpl()
override val userSessionScopeProvider: Lazy<UserSessionScopeProvider> = lazy {
Expand All @@ -57,7 +71,7 @@ actual class CoreLogic(
kaliumConfigs,
globalPreferences,
globalCallManager,
globalDatabase,
globalDatabaseBuilder,
userStorageProvider,
networkStateObserver,
logoutCallbackManager,
Expand All @@ -73,10 +87,8 @@ actual class CoreLogic(
userSessionScopeProvider.value.delete(userId)
}

override val globalCallManager: GlobalCallManager
= GlobalCallManager()
override val globalWorkScheduler: GlobalWorkScheduler
= GlobalWorkSchedulerImpl(this)
override val globalCallManager: GlobalCallManager = GlobalCallManager()
override val globalWorkScheduler: GlobalWorkScheduler = GlobalWorkSchedulerImpl(this)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ package com.wire.kalium.logic.di

import com.wire.kalium.logic.data.id.toDao
import com.wire.kalium.logic.data.user.UserId
import com.wire.kalium.persistence.db.userDatabaseBuilder
import com.wire.kalium.persistence.db.PlatformDatabaseData
import com.wire.kalium.persistence.db.StorageData
import com.wire.kalium.persistence.db.userDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.UserPrefBuilder
import com.wire.kalium.util.KaliumDispatcherImpl

Expand All @@ -30,7 +31,7 @@ internal actual class PlatformUserStorageProvider actual constructor() : UserSto
val userIdEntity = userId.toDao()
val pref = UserPrefBuilder(userIdEntity, platformProperties.rootPath, shouldEncryptData)
val database = userDatabaseBuilder(
PlatformDatabaseData(platformProperties.rootStoragePath),
PlatformDatabaseData(StorageData.FileBacked(platformProperties.rootStoragePath)),
userIdEntity,
null,
KaliumDispatcherImpl.io,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import com.wire.kalium.logic.feature.call.GlobalCallManager
import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.logic.sync.UserSessionWorkScheduler
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider

@Suppress("LongParameterList")
Expand All @@ -43,7 +43,7 @@ internal fun UserSessionScope(
globalScope: GlobalKaliumScope,
globalCallManager: GlobalCallManager,
globalPreferences: GlobalPrefProvider,
globalDatabaseProvider: GlobalDatabaseProvider,
globalDatabaseBuilder: GlobalDatabaseBuilder,
authenticationScopeProvider: AuthenticationScopeProvider,
userSessionWorkScheduler: UserSessionWorkScheduler,
rootPathsProvider: RootPathsProvider,
Expand All @@ -63,7 +63,7 @@ internal fun UserSessionScope(
userId,
globalScope,
globalCallManager,
globalDatabaseProvider,
globalDatabaseBuilder,
globalPreferences,
authenticationScopeProvider,
userSessionWorkScheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import com.wire.kalium.logic.feature.call.GlobalCallManager
import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.logic.sync.UserSessionWorkSchedulerImpl
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider

@Suppress("LongParameterList")
Expand All @@ -45,7 +45,7 @@ internal actual class UserSessionScopeProviderImpl(
private val kaliumConfigs: KaliumConfigs,
private val globalPreferences: GlobalPrefProvider,
private val globalCallManager: GlobalCallManager,
private val globalDatabaseProvider: GlobalDatabaseProvider,
private val globalDatabaseBuilder: GlobalDatabaseBuilder,
private val userStorageProvider: UserStorageProvider,
private val networkStateObserver: NetworkStateObserver,
private val logoutCallback: LogoutCallback,
Expand All @@ -65,7 +65,7 @@ internal actual class UserSessionScopeProviderImpl(
globalScope,
globalCallManager,
globalPreferences,
globalDatabaseProvider,
globalDatabaseBuilder,
authenticationScopeProvider,
userSessionWorkScheduler,
rootPathsProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.logic.sync.GlobalWorkScheduler
import com.wire.kalium.logic.sync.periodic.UpdateApiVersionsScheduler
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider

expect class CoreLogic : CoreLogicCommon
Expand All @@ -50,7 +50,7 @@ abstract class CoreLogicCommon internal constructor(
protected val idMapper: IdMapper = MapperProvider.idMapper()
) {
protected abstract val globalPreferences: GlobalPrefProvider
protected abstract val globalDatabase: GlobalDatabaseProvider
protected abstract val globalDatabaseBuilder: GlobalDatabaseBuilder
protected abstract val userSessionScopeProvider: Lazy<UserSessionScopeProvider>
protected val userStorageProvider: UserStorageProvider = PlatformUserStorageProvider()

Expand All @@ -61,7 +61,7 @@ abstract class CoreLogicCommon internal constructor(
private val globalKaliumScope by lazy {
GlobalKaliumScope(
userAgent,
globalDatabase,
globalDatabaseBuilder,
globalPreferences,
kaliumConfigs,
userSessionScopeProvider,
Expand All @@ -81,7 +81,7 @@ abstract class CoreLogicCommon internal constructor(
serverConfig,
proxyCredentials,
networkStateObserver,
globalDatabase,
globalDatabaseBuilder,
kaliumConfigs
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import com.wire.kalium.logic.featureFlags.KaliumConfigs
import com.wire.kalium.network.NetworkStateObserver
import com.wire.kalium.network.networkContainer.UnboundNetworkContainer
import com.wire.kalium.network.networkContainer.UnboundNetworkContainerCommon
import com.wire.kalium.persistence.db.GlobalDatabaseProvider
import com.wire.kalium.persistence.db.GlobalDatabaseBuilder
import com.wire.kalium.persistence.kmmSettings.GlobalPrefProvider
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
Expand All @@ -85,7 +85,7 @@ import kotlin.coroutines.CoroutineContext
@Suppress("LongParameterList")
class GlobalKaliumScope internal constructor(
userAgent: String,
private val globalDatabase: GlobalDatabaseProvider,
private val globalDatabase: GlobalDatabaseBuilder,
private val globalPreferences: GlobalPrefProvider,
private val kaliumConfigs: KaliumConfigs,
private val userSessionScopeProvider: Lazy<UserSessionScopeProvider>,
Expand Down
Loading

0 comments on commit dd7669e

Please sign in to comment.