diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 42c4dc2473..f6f202121a 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,9 +1,6 @@ - - diff --git a/app/src/main/java/com/anytypeio/anytype/di/feature/MainEntryDI.kt b/app/src/main/java/com/anytypeio/anytype/di/feature/MainEntryDI.kt index 2f5661b105..3f69360fed 100644 --- a/app/src/main/java/com/anytypeio/anytype/di/feature/MainEntryDI.kt +++ b/app/src/main/java/com/anytypeio/anytype/di/feature/MainEntryDI.kt @@ -11,7 +11,6 @@ import com.anytypeio.anytype.domain.auth.interactor.ResumeAccount import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.AppCoroutineDispatchers import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.config.UserSettingsRepository import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.misc.LocaleProvider @@ -87,14 +86,12 @@ object MainEntryModule { authRepository: AuthRepository, pathProvider: PathProvider, configStorage: ConfigStorage, - featuresConfigProvider: FeaturesConfigProvider, metricsProvider: MetricsProvider, awaitAccountStartManager: AwaitAccountStartManager ): ResumeAccount = ResumeAccount( repository = authRepository, pathProvider = pathProvider, configStorage = configStorage, - featuresConfigProvider = featuresConfigProvider, metricsProvider = metricsProvider, awaitAccountStartManager = awaitAccountStartManager ) diff --git a/app/src/main/java/com/anytypeio/anytype/di/feature/SplashDi.kt b/app/src/main/java/com/anytypeio/anytype/di/feature/SplashDi.kt index 6ebf7edc72..1385db495a 100644 --- a/app/src/main/java/com/anytypeio/anytype/di/feature/SplashDi.kt +++ b/app/src/main/java/com/anytypeio/anytype/di/feature/SplashDi.kt @@ -15,7 +15,6 @@ import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.AppCoroutineDispatchers import com.anytypeio.anytype.domain.block.repo.BlockRepository import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.config.UserSettingsRepository import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.launch.GetDefaultObjectType @@ -72,7 +71,6 @@ object SplashModule { fun provideLaunchAccountUseCase( authRepository: AuthRepository, pathProvider: PathProvider, - featuresConfigProvider: FeaturesConfigProvider, configStorage: ConfigStorage, spaceManager: SpaceManager, metricsProvider: MetricsProvider, @@ -81,7 +79,6 @@ object SplashModule { ): LaunchAccount = LaunchAccount( repository = authRepository, pathProvider = pathProvider, - featuresConfigProvider = featuresConfigProvider, configStorage = configStorage, spaceManager = spaceManager, metricsProvider = metricsProvider, @@ -185,7 +182,6 @@ interface SplashDependencies : ComponentDependencies { fun objectTypesSubscriptionManager(): ObjectTypesSubscriptionManager fun authRepository(): AuthRepository fun pathProvider(): PathProvider - fun featuresConfigProvider(): FeaturesConfigProvider fun featureToggles(): FeatureToggles fun configStorage(): ConfigStorage fun userSettingsRepository(): UserSettingsRepository diff --git a/app/src/main/java/com/anytypeio/anytype/di/feature/onboarding/login/OnboardingMnemonicLoginDI.kt b/app/src/main/java/com/anytypeio/anytype/di/feature/onboarding/login/OnboardingMnemonicLoginDI.kt index 80b3754871..eec72f0b8c 100644 --- a/app/src/main/java/com/anytypeio/anytype/di/feature/onboarding/login/OnboardingMnemonicLoginDI.kt +++ b/app/src/main/java/com/anytypeio/anytype/di/feature/onboarding/login/OnboardingMnemonicLoginDI.kt @@ -8,7 +8,6 @@ import com.anytypeio.anytype.di.common.ComponentDependencies import com.anytypeio.anytype.domain.account.AwaitAccountStartManager import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.misc.LocaleProvider import com.anytypeio.anytype.domain.platform.MetricsProvider @@ -57,7 +56,6 @@ interface OnboardingMnemonicLoginDependencies : ComponentDependencies { fun pathProvider(): PathProvider fun crashReporter(): CrashReporter fun configStorage(): ConfigStorage - fun featureConfigProvider(): FeaturesConfigProvider fun metricsProvider(): MetricsProvider fun objectTypesSubscriptionManager(): ObjectTypesSubscriptionManager fun relationsSubscriptionManager(): RelationsSubscriptionManager diff --git a/app/src/main/java/com/anytypeio/anytype/di/main/DataModule.kt b/app/src/main/java/com/anytypeio/anytype/di/main/DataModule.kt index f876068760..b0079229db 100644 --- a/app/src/main/java/com/anytypeio/anytype/di/main/DataModule.kt +++ b/app/src/main/java/com/anytypeio/anytype/di/main/DataModule.kt @@ -7,7 +7,6 @@ import androidx.security.crypto.MasterKeys import com.anytypeio.anytype.app.DefaultAppActionManager import com.anytypeio.anytype.app.DefaultMetricsProvider import com.anytypeio.anytype.core_utils.tools.ThreadInfo -import com.anytypeio.anytype.data.auth.config.DefaultFeaturesConfigProvider import com.anytypeio.anytype.data.auth.repo.AuthCache import com.anytypeio.anytype.data.auth.repo.AuthCacheDataStore import com.anytypeio.anytype.data.auth.repo.AuthDataRepository @@ -28,7 +27,6 @@ import com.anytypeio.anytype.device.DefaultBuildProvider import com.anytypeio.anytype.device.DefaultPathProvider import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.block.repo.BlockRepository -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.config.InfrastructureRepository import com.anytypeio.anytype.domain.config.UserSettingsRepository import com.anytypeio.anytype.domain.debugging.DebugConfig @@ -258,13 +256,6 @@ object DataModule { @Singleton fun provideMiddlewareFactory(): MiddlewareFactory = MiddlewareFactory() - @JvmStatic - @Provides - @Singleton - fun provideFeaturesConfigProvider(): FeaturesConfigProvider { - return DefaultFeaturesConfigProvider() - } - @JvmStatic @Provides @Singleton diff --git a/core-models/src/main/java/com/anytypeio/anytype/core_models/AccountSetup.kt b/core-models/src/main/java/com/anytypeio/anytype/core_models/AccountSetup.kt index a21c1cfd9f..70bae1aecf 100644 --- a/core-models/src/main/java/com/anytypeio/anytype/core_models/AccountSetup.kt +++ b/core-models/src/main/java/com/anytypeio/anytype/core_models/AccountSetup.kt @@ -3,6 +3,5 @@ package com.anytypeio.anytype.core_models data class AccountSetup( val account: Account, val config: Config, - val features: FeaturesConfig, val status: AccountStatus ) \ No newline at end of file diff --git a/core-models/src/main/java/com/anytypeio/anytype/core_models/FeaturesConfig.kt b/core-models/src/main/java/com/anytypeio/anytype/core_models/FeaturesConfig.kt deleted file mode 100644 index 20eac4975b..0000000000 --- a/core-models/src/main/java/com/anytypeio/anytype/core_models/FeaturesConfig.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.anytypeio.anytype.core_models - -@Deprecated("Should be deleted") -data class FeaturesConfig( - val enableDataView: Boolean? = null, - val enableDebug: Boolean? = null, - val enablePrereleaseChannel: Boolean? = null, - val enableSpaces: Boolean? = null -) \ No newline at end of file diff --git a/data/src/main/java/com/anytypeio/anytype/data/auth/config/DefaultFeaturesConfigProvider.kt b/data/src/main/java/com/anytypeio/anytype/data/auth/config/DefaultFeaturesConfigProvider.kt deleted file mode 100644 index 79b1a51d7f..0000000000 --- a/data/src/main/java/com/anytypeio/anytype/data/auth/config/DefaultFeaturesConfigProvider.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.anytypeio.anytype.data.auth.config - -import com.anytypeio.anytype.core_models.FeaturesConfig -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider - -/** - * Features config provider for real-world application. - */ -class DefaultFeaturesConfigProvider : FeaturesConfigProvider { - - private var config: FeaturesConfig = FeaturesConfig( - enableDataView = false, - enableDebug = false, - enablePrereleaseChannel = false, - enableSpaces = false - ) - - override fun get(): FeaturesConfig = config - - override fun set( - enableDataView: Boolean, - enableDebug: Boolean, - enableChannelSwitch: Boolean, - enableSpaces: Boolean - ) { - config = FeaturesConfig( - enableDataView = enableDataView, - enableDebug = enableDebug, - enablePrereleaseChannel = enableChannelSwitch, - enableSpaces = enableSpaces - ) - } -} \ No newline at end of file diff --git a/data/src/main/java/com/anytypeio/anytype/data/auth/mapper/MapperExtension.kt b/data/src/main/java/com/anytypeio/anytype/data/auth/mapper/MapperExtension.kt index c7e9ad8fd2..26167e45a7 100644 --- a/data/src/main/java/com/anytypeio/anytype/data/auth/mapper/MapperExtension.kt +++ b/data/src/main/java/com/anytypeio/anytype/data/auth/mapper/MapperExtension.kt @@ -2,10 +2,8 @@ package com.anytypeio.anytype.data.auth.mapper import com.anytypeio.anytype.core_models.Account import com.anytypeio.anytype.data.auth.model.AccountEntity -import com.anytypeio.anytype.data.auth.model.FeaturesConfigEntity import com.anytypeio.anytype.data.auth.model.WalletEntity import com.anytypeio.anytype.domain.auth.model.Wallet -import com.anytypeio.anytype.core_models.FeaturesConfig fun AccountEntity.toDomain(): Account { return Account( @@ -16,15 +14,6 @@ fun AccountEntity.toDomain(): Account { ) } -fun FeaturesConfigEntity.toDomain(): FeaturesConfig { - return FeaturesConfig( - enableDataView = enableDataView, - enableDebug = enableDebug, - enablePrereleaseChannel = enableChannelSwitch, - enableSpaces = enableSpaces - ) -} - fun Account.toEntity(): AccountEntity { return AccountEntity( id = id, diff --git a/data/src/main/java/com/anytypeio/anytype/data/auth/model/FeaturesConfigEntity.kt b/data/src/main/java/com/anytypeio/anytype/data/auth/model/FeaturesConfigEntity.kt deleted file mode 100644 index a48f94a0e9..0000000000 --- a/data/src/main/java/com/anytypeio/anytype/data/auth/model/FeaturesConfigEntity.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.anytypeio.anytype.data.auth.model - -data class FeaturesConfigEntity( - val enableDataView: Boolean? = null, - val enableDebug: Boolean? = null, - val enableChannelSwitch: Boolean? = null, - val enableSpaces: Boolean? = null -) diff --git a/data/src/test/java/com/anytypeio/anytype/data/AuthDataRepositoryTest.kt b/data/src/test/java/com/anytypeio/anytype/data/AuthDataRepositoryTest.kt index 997dac3934..cd27e81dcd 100644 --- a/data/src/test/java/com/anytypeio/anytype/data/AuthDataRepositoryTest.kt +++ b/data/src/test/java/com/anytypeio/anytype/data/AuthDataRepositoryTest.kt @@ -3,7 +3,6 @@ package com.anytypeio.anytype.data import com.anytypeio.anytype.core_models.Command import com.anytypeio.anytype.core_models.StubAccount import com.anytypeio.anytype.core_models.StubAccountSetup -import com.anytypeio.anytype.core_models.StubFeatureConfig import com.anytypeio.anytype.data.auth.model.AccountEntity import com.anytypeio.anytype.data.auth.model.WalletEntity import com.anytypeio.anytype.data.auth.repo.AuthCache @@ -66,16 +65,13 @@ class AuthDataRepositoryTest { val account = StubAccount() - val features = StubFeatureConfig() - authRemote.stub { val command = Command.AccountSelect( id = id, path = path ) onBlocking { selectAccount(command) } doReturn StubAccountSetup( - account = account, - features = features + account = account ) } diff --git a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/LaunchAccount.kt b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/LaunchAccount.kt index 6aa67982cb..9befe5b743 100644 --- a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/LaunchAccount.kt +++ b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/LaunchAccount.kt @@ -6,7 +6,6 @@ import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.BaseUseCase import com.anytypeio.anytype.domain.base.Either import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.config.UserSettingsRepository import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.platform.MetricsProvider @@ -23,7 +22,6 @@ class LaunchAccount @Inject constructor( private val pathProvider: PathProvider, private val context: CoroutineContext = Dispatchers.IO, private val configStorage: ConfigStorage, - private val featuresConfigProvider: FeaturesConfigProvider, private val spaceManager: SpaceManager, private val metricsProvider: MetricsProvider, private val settings: UserSettingsRepository, @@ -46,12 +44,6 @@ class LaunchAccount @Inject constructor( ) repository.selectAccount(command).let { setup -> repository.updateAccount(setup.account) - featuresConfigProvider.set( - enableDataView = setup.features.enableDataView ?: false, - enableDebug = setup.features.enableDebug ?: false, - enableChannelSwitch = setup.features.enablePrereleaseChannel ?: false, - enableSpaces = setup.features.enableSpaces ?: false - ) configStorage.set(config = setup.config) val lastSessionSpace = settings.getCurrentSpace() if (lastSessionSpace != null) { diff --git a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/ResumeAccount.kt b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/ResumeAccount.kt index 9f278742db..e9f832fd1d 100644 --- a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/ResumeAccount.kt +++ b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/ResumeAccount.kt @@ -6,7 +6,6 @@ import com.anytypeio.anytype.domain.account.AwaitAccountStartManager import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.BaseUseCase import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.platform.MetricsProvider @@ -17,7 +16,6 @@ class ResumeAccount( private val repository: AuthRepository, private val pathProvider: PathProvider, private val configStorage: ConfigStorage, - private val featuresConfigProvider: FeaturesConfigProvider, private val metricsProvider: MetricsProvider, private val awaitAccountStartManager: AwaitAccountStartManager ) : BaseUseCase() { @@ -43,12 +41,6 @@ class ResumeAccount( networkConfigFilePath = networkMode.storedFilePath ) val result = repository.selectAccount(command).let { setup -> - featuresConfigProvider.set( - enableDataView = setup.features.enableDataView ?: false, - enableDebug = setup.features.enableDebug ?: false, - enableChannelSwitch = setup.features.enablePrereleaseChannel ?: false, - enableSpaces = setup.features.enableSpaces ?: false - ) configStorage.set(config = setup.config) setup.account.id } diff --git a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/SelectAccount.kt b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/SelectAccount.kt index 748f7e32ef..de7b4c9c79 100644 --- a/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/SelectAccount.kt +++ b/domain/src/main/java/com/anytypeio/anytype/domain/auth/interactor/SelectAccount.kt @@ -7,7 +7,6 @@ import com.anytypeio.anytype.domain.account.AwaitAccountStartManager import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.BaseUseCase import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.platform.MetricsProvider import javax.inject.Inject @@ -17,7 +16,6 @@ import javax.inject.Inject class SelectAccount @Inject constructor( private val repository: AuthRepository, private val configStorage: ConfigStorage, - private val featuresConfigProvider: FeaturesConfigProvider, private val metricsProvider: MetricsProvider, private val awaitAccountStartManager: AwaitAccountStartManager ) : BaseUseCase() { @@ -41,12 +39,6 @@ class SelectAccount @Inject constructor( saveAccount(setup.account) setCurrentAccount(setup.account.id) } - featuresConfigProvider.set( - enableDataView = setup.features.enableDataView ?: false, - enableDebug = setup.features.enableDebug ?: false, - enableChannelSwitch = setup.features.enablePrereleaseChannel ?: false, - enableSpaces = setup.features.enableSpaces ?: false - ) configStorage.set(config = setup.config) awaitAccountStartManager.setIsStarted(true) StartAccountResult(setup.config.analytics, setup.status) diff --git a/domain/src/main/java/com/anytypeio/anytype/domain/config/FeaturesConfigProvider.kt b/domain/src/main/java/com/anytypeio/anytype/domain/config/FeaturesConfigProvider.kt deleted file mode 100644 index f199d59e13..0000000000 --- a/domain/src/main/java/com/anytypeio/anytype/domain/config/FeaturesConfigProvider.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.anytypeio.anytype.domain.config - -import com.anytypeio.anytype.core_models.FeaturesConfig - -interface FeaturesConfigProvider { - - fun get(): FeaturesConfig - - fun set( - enableDataView: Boolean, - enableDebug: Boolean, - enableChannelSwitch: Boolean, - enableSpaces: Boolean - ) -} \ No newline at end of file diff --git a/domain/src/test/java/com/anytypeio/anytype/domain/auth/ResumeAccountTest.kt b/domain/src/test/java/com/anytypeio/anytype/domain/auth/ResumeAccountTest.kt index de9bb9d1c0..29d8142d65 100644 --- a/domain/src/test/java/com/anytypeio/anytype/domain/auth/ResumeAccountTest.kt +++ b/domain/src/test/java/com/anytypeio/anytype/domain/auth/ResumeAccountTest.kt @@ -6,7 +6,6 @@ import com.anytypeio.anytype.domain.account.AwaitAccountStartManager import com.anytypeio.anytype.domain.auth.interactor.ResumeAccount import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.device.PathProvider import com.anytypeio.anytype.domain.platform.MetricsProvider import com.anytypeio.anytype.domain.workspace.WorkspaceManager @@ -25,9 +24,6 @@ class ResumeAccountTest { @Mock lateinit var repo: AuthRepository - @Mock - lateinit var featuresConfigProvider: FeaturesConfigProvider - @Mock lateinit var configStorage: ConfigStorage @@ -53,7 +49,6 @@ class ResumeAccountTest { resumeAccount = ResumeAccount( repository = repo, configStorage = configStorage, - featuresConfigProvider = featuresConfigProvider, pathProvider = pathProvider, metricsProvider = metricsProvider, awaitAccountStartManager = awaitAccountStartManager diff --git a/domain/src/test/java/com/anytypeio/anytype/domain/auth/StartAccountTest.kt b/domain/src/test/java/com/anytypeio/anytype/domain/auth/StartAccountTest.kt index 79d7ff41a2..33d1475faa 100644 --- a/domain/src/test/java/com/anytypeio/anytype/domain/auth/StartAccountTest.kt +++ b/domain/src/test/java/com/anytypeio/anytype/domain/auth/StartAccountTest.kt @@ -5,7 +5,6 @@ import com.anytypeio.anytype.core_models.AccountSetup import com.anytypeio.anytype.core_models.AccountStatus import com.anytypeio.anytype.core_models.Command import com.anytypeio.anytype.core_models.CoroutineTestRule -import com.anytypeio.anytype.core_models.FeaturesConfig import com.anytypeio.anytype.core_models.NetworkMode import com.anytypeio.anytype.core_models.NetworkModeConfig import com.anytypeio.anytype.core_models.StubConfig @@ -14,7 +13,6 @@ import com.anytypeio.anytype.domain.auth.interactor.SelectAccount import com.anytypeio.anytype.domain.auth.repo.AuthRepository import com.anytypeio.anytype.domain.base.Either import com.anytypeio.anytype.domain.config.ConfigStorage -import com.anytypeio.anytype.domain.config.FeaturesConfigProvider import com.anytypeio.anytype.domain.platform.MetricsProvider import com.anytypeio.anytype.domain.workspace.WorkspaceManager import com.anytypeio.anytype.test_utils.MockDataFactory @@ -41,9 +39,6 @@ class StartAccountTest { @Mock lateinit var repo: AuthRepository - @Mock - lateinit var featuresConfigProvider: FeaturesConfigProvider - @Mock lateinit var configStorage: ConfigStorage @@ -69,7 +64,6 @@ class StartAccountTest { selectAccount = SelectAccount( repository = repo, configStorage = configStorage, - featuresConfigProvider = featuresConfigProvider, metricsProvider = metricsProvider, awaitAccountStartManager = awaitAccountStartManager ) @@ -93,12 +87,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = false, - enableDebug = false, - enablePrereleaseChannel = false - ) - repo.stub { onBlocking { getNetworkMode() @@ -117,7 +105,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -169,12 +156,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = false, - enableDebug = false, - enablePrereleaseChannel = false - ) - repo.stub { onBlocking { getNetworkMode() @@ -193,7 +174,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -222,12 +202,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = null, - enableDebug = null, - enablePrereleaseChannel = null - ) - repo.stub { onBlocking { getNetworkMode() @@ -246,7 +220,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -254,13 +227,6 @@ class StartAccountTest { val result = selectAccount.run(params) - verify(featuresConfigProvider, times(1)).set( - enableDataView = false, - enableDebug = false, - enableChannelSwitch = false, - enableSpaces = false - ) - assertTrue { result == Either.Right(Pair(config.analytics, AccountStatus.Active)) } } @@ -282,12 +248,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = true, - enableDebug = false, - enablePrereleaseChannel = true - ) - repo.stub { onBlocking { getNetworkMode() @@ -306,7 +266,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -314,13 +273,6 @@ class StartAccountTest { val result = selectAccount.run(params) - verify(featuresConfigProvider, times(1)).set( - enableDataView = true, - enableDebug = false, - enableChannelSwitch = true, - enableSpaces = false - ) - assertTrue { result == Either.Right(Pair(config.analytics, AccountStatus.Active)) } } @@ -342,12 +294,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = true, - enableDebug = false, - enablePrereleaseChannel = true - ) - repo.stub { onBlocking { getNetworkMode() @@ -366,7 +312,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -374,13 +319,6 @@ class StartAccountTest { val result = selectAccount.run(params) - verify(featuresConfigProvider, times(1)).set( - enableDataView = true, - enableDebug = false, - enableChannelSwitch = true, - enableSpaces = false - ) - assertTrue { result == Either.Right(Pair(config.analytics, AccountStatus.Active)) } } @@ -402,12 +340,6 @@ class StartAccountTest { color = null ) - val featuresConfig = FeaturesConfig( - enableDataView = true, - enableDebug = false, - enablePrereleaseChannel = true - ) - val storedFilePath = MockDataFactory.randomString() val userPath = MockDataFactory.randomString() @@ -432,7 +364,6 @@ class StartAccountTest { selectAccount(command) } doReturn AccountSetup( account = account, - features = featuresConfig, status = AccountStatus.Active, config = config ) @@ -440,13 +371,6 @@ class StartAccountTest { val result = selectAccount.run(params) - verify(featuresConfigProvider, times(1)).set( - enableDataView = true, - enableDebug = false, - enableChannelSwitch = true, - enableSpaces = false - ) - assertTrue { result == Either.Right(Pair(config.analytics, AccountStatus.Active)) } } diff --git a/middleware/src/main/java/com/anytypeio/anytype/middleware/auth/AuthMappers.kt b/middleware/src/main/java/com/anytypeio/anytype/middleware/auth/AuthMappers.kt index e19bf2cfc5..0c4e48f13d 100644 --- a/middleware/src/main/java/com/anytypeio/anytype/middleware/auth/AuthMappers.kt +++ b/middleware/src/main/java/com/anytypeio/anytype/middleware/auth/AuthMappers.kt @@ -5,7 +5,6 @@ import com.anytypeio.anytype.core_models.Account import com.anytypeio.anytype.core_models.AccountSetup import com.anytypeio.anytype.core_models.AccountStatus import com.anytypeio.anytype.core_models.Config -import com.anytypeio.anytype.core_models.FeaturesConfig import com.anytypeio.anytype.middleware.mappers.config import com.anytypeio.anytype.middleware.mappers.core @@ -23,7 +22,6 @@ fun Rpc.Account.Create.Response.toAccountSetup() : AccountSetup { color = acc.avatar?.color, avatar = null ), - features = FeaturesConfig(), config = info.config(), status = status?.core() ?: AccountStatus.Unknown ) @@ -43,7 +41,6 @@ fun Rpc.Account.Select.Response.toAccountSetup(): AccountSetup { color = acc.avatar?.color, avatar = null ), - features = FeaturesConfig(), config = Config( home = info.homeObjectId, profile = info.profileObjectId, diff --git a/test/core-models-stub/src/main/java/com/anytypeio/anytype/core_models/Auth.kt b/test/core-models-stub/src/main/java/com/anytypeio/anytype/core_models/Auth.kt index 96f09afcac..08a85f2e36 100644 --- a/test/core-models-stub/src/main/java/com/anytypeio/anytype/core_models/Auth.kt +++ b/test/core-models-stub/src/main/java/com/anytypeio/anytype/core_models/Auth.kt @@ -5,11 +5,9 @@ import com.anytypeio.anytype.test_utils.MockDataFactory fun StubAccountSetup( account : Account = StubAccount(), config: Config = StubConfig(), - features: FeaturesConfig = StubFeatureConfig(), status: AccountStatus = AccountStatus.Active ) : AccountSetup = AccountSetup( account = account, - features = features, status = status, config = config ) @@ -48,16 +46,4 @@ fun StubConfig( analytics = analytics, device = device, network = network -) - -fun StubFeatureConfig( - enableDataView: Boolean? = MockDataFactory.randomBoolean(), - enableDebug: Boolean? = MockDataFactory.randomBoolean(), - enableChannelSwitch: Boolean? = MockDataFactory.randomBoolean(), - enableSpaces: Boolean? = MockDataFactory.randomBoolean() -) : FeaturesConfig = FeaturesConfig( - enableDataView = enableDataView, - enableDebug = enableDebug, - enablePrereleaseChannel = enableChannelSwitch, - enableSpaces = enableSpaces ) \ No newline at end of file