From cf8f2ff7fa4e15287b92891c7ddb6e2ce87b4a3c Mon Sep 17 00:00:00 2001 From: Shannon Draeker <125921730+shannon-livefront@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:24:00 -0700 Subject: [PATCH] Fixed login bug (#882) --- .../auth/repository/AuthRepositoryImpl.kt | 22 ++++------- .../data/auth/repository/model/UserState.kt | 3 -- .../util/UserStateJsonExtensions.kt | 2 - .../data/vault/manager/VaultLockManager.kt | 6 --- .../vault/manager/VaultLockManagerImpl.kt | 12 +----- .../vault/repository/model/VaultUnlockData.kt | 1 - .../feature/rootnav/RootNavViewModel.kt | 1 - .../com/x8bit/bitwarden/MainViewModelTest.kt | 1 - .../auth/repository/AuthRepositoryTest.kt | 5 --- .../util/UserStateJsonExtensionsTest.kt | 2 - .../vault/manager/VaultLockManagerTest.kt | 3 -- .../feature/landing/LandingViewModelTest.kt | 3 -- .../auth/feature/login/LoginViewModelTest.kt | 1 - .../vaultunlock/VaultUnlockViewModelTest.kt | 3 -- .../feature/rootnav/RootNavViewModelTest.kt | 37 ------------------- .../feature/search/SearchViewModelTest.kt | 1 - .../LoginApprovalViewModelTest.kt | 1 - .../generator/GeneratorViewModelTest.kt | 1 - .../send/addsend/AddSendViewModelTest.kt | 1 - .../addedit/VaultAddEditViewModelTest.kt | 1 - .../attachments/AttachmentsViewModelTest.kt | 1 - .../feature/item/VaultItemViewModelTest.kt | 1 - .../VaultItemListingViewModelTest.kt | 1 - .../VaultMoveToOrganizationViewModelTest.kt | 1 - .../VaultMoveToOrganizationExtensionsTest.kt | 1 - .../vault/feature/vault/VaultViewModelTest.kt | 3 -- .../vault/util/UserStateExtensionsTest.kt | 9 ----- 27 files changed, 8 insertions(+), 116 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt index 32ceec9d0..d819c81c1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt @@ -256,18 +256,13 @@ class AuthRepositoryImpl( authDiskSource.currentUserPoliciesListFlow .onEach { policies -> val userId = activeUserId ?: return@onEach - if (passwordPassesPolicies(policies)) { - vaultRepository.completeUnlock(userId = userId) - storeUserResetPasswordReason( - userId = userId, - reason = null, - ) - } else { - storeUserResetPasswordReason( - userId = userId, - reason = ForcePasswordResetReason.WEAK_MASTER_PASSWORD_ON_LOGIN, - ) - } + storeUserResetPasswordReason( + userId = userId, + reason = ForcePasswordResetReason.WEAK_MASTER_PASSWORD_ON_LOGIN + .takeIf { + !passwordPassesPolicies(policies) + }, + ) } .launchIn(unconfinedScope) } @@ -711,9 +706,6 @@ class AuthRepositoryImpl( ) } - // Complete the login flow. - vaultRepository.completeUnlock(userId = activeAccount.profile.userId) - // Return the success. ResetPasswordResult.Success }, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt index 0173ab1bd..de83dc9ef 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt @@ -40,8 +40,6 @@ data class UserState( * @property isLoggedIn `true` if the account is logged in, or `false` if it requires additional * authentication to view their vault. * @property isVaultUnlocked Whether or not the user's vault is currently unlocked. - * @property isVaultPendingUnlock Whether or not the user's vault is currently pending being - * unlocked, such as when the password policy has not completed verification yet. * @property needsPasswordReset If the user needs to reset their password. * @property organizations List of [Organization]s the user is associated with, if any. * @property isBiometricsEnabled Indicates that the biometrics mechanism for unlocking the @@ -57,7 +55,6 @@ data class UserState( val isPremium: Boolean, val isLoggedIn: Boolean, val isVaultUnlocked: Boolean, - val isVaultPendingUnlock: Boolean, val needsPasswordReset: Boolean, val organizations: List, val isBiometricsEnabled: Boolean, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt index 6003172aa..cf3374c7b 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt @@ -72,8 +72,6 @@ fun UserStateJson.toUserState( isLoggedIn = accountJson.isLoggedIn, isVaultUnlocked = vaultState.statusFor(userId) == VaultUnlockData.Status.UNLOCKED, - isVaultPendingUnlock = vaultState.statusFor(userId) == - VaultUnlockData.Status.PENDING, needsPasswordReset = accountJson.profile.forcePasswordResetReason != null, organizations = userOrganizationsList .find { it.userId == userId } diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt index c494bfdc5..0ff153f6a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt @@ -30,12 +30,6 @@ interface VaultLockManager { */ fun lockVault(userId: String) - /** - * Complete the unlock flow for a given [userId], moving their pendingUnlock status - * to a full unlock. - */ - fun completeUnlock(userId: String) - /** * Locks the vault for the current user if currently unlocked. */ diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt index 216b8d035..f614e7c75 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt @@ -92,10 +92,6 @@ class VaultLockManagerImpl( setVaultToLocked(userId = userId) } - override fun completeUnlock(userId: String) { - setVaultToUnlocked(userId = userId) - } - override fun lockVaultForCurrentUser() { activeUserId?.let { lockVault(it) @@ -168,7 +164,7 @@ class VaultLockManagerImpl( .also { if (it is VaultUnlockResult.Success) { clearInvalidUnlockCount(userId = userId) - setVaultToPendingUnlocked(userId = userId) + setVaultToUnlocked(userId = userId) } else { incrementInvalidUnlockCount(userId = userId) } @@ -214,12 +210,6 @@ class VaultLockManagerImpl( storeUserAutoUnlockKeyIfNecessary(userId = userId) } - private fun setVaultToPendingUnlocked(userId: String) { - mutableVaultUnlockDataStateFlow.update { - it.update(userId, VaultUnlockData.Status.PENDING) - } - } - private fun setVaultToLocked(userId: String) { vaultSdkSource.clearCrypto(userId = userId) mutableVaultUnlockDataStateFlow.update { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/VaultUnlockData.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/VaultUnlockData.kt index a57bac85a..bed0bbbd1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/VaultUnlockData.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/model/VaultUnlockData.kt @@ -14,7 +14,6 @@ data class VaultUnlockData( * The lock status of a user's vault. */ enum class Status { - PENDING, UNLOCKED, UNLOCKING, } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt index 18c7625d1..adb7b5845 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt @@ -63,7 +63,6 @@ class RootNavViewModel @Inject constructor( userState == null || !userState.activeAccount.isLoggedIn || - userState.activeAccount.isVaultPendingUnlock || userState.hasPendingAccountAddition -> RootNavState.Auth userState.activeAccount.isVaultUnlocked -> { diff --git a/app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt index 75992f1db..50eba0adb 100644 --- a/app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt @@ -262,7 +262,6 @@ class MainViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt index af953985b..1b4aae4e0 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt @@ -119,7 +119,6 @@ class AuthRepositoryTest { private val mutableVaultUnlockDataStateFlow = MutableStateFlow(VAULT_UNLOCK_DATA) private val vaultRepository: VaultRepository = mockk { every { vaultUnlockDataStateFlow } returns mutableVaultUnlockDataStateFlow - every { completeUnlock(any()) } just runs every { deleteVaultData(any()) } just runs every { clearUnlockedData() } just runs } @@ -857,7 +856,6 @@ class AuthRepositoryTest { ) verify { settingsRepository.setDefaultsIfNecessary(userId = USER_ID_1) } verify { vaultRepository.clearUnlockedData() } - verify { vaultRepository.completeUnlock(userId = USER_ID_1) } } @Suppress("MaxLineLength") @@ -2039,9 +2037,6 @@ class AuthRepositoryTest { ), ) } - verify { - vaultRepository.completeUnlock(userId = USER_ID_1) - } fakeAuthDiskSource.assertMasterPasswordHash( userId = USER_ID_1, passwordHash = PASSWORD_HASH, diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt index 5a7ef5aed..6f065ff41 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt @@ -107,7 +107,6 @@ class UserStateJsonExtensionsTest { isPremium = false, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, organizations = listOf( Organization( @@ -183,7 +182,6 @@ class UserStateJsonExtensionsTest { isPremium = true, isLoggedIn = false, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, organizations = listOf( Organization( diff --git a/app/src/test/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt index 07444d527..2634855dc 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt @@ -723,7 +723,6 @@ class VaultLockManagerTest { privateKey = privateKey, organizationKeys = organizationKeys, ) - vaultLockManager.completeUnlock(userId = USER_ID) assertEquals(VaultUnlockResult.Success, result) assertEquals( @@ -827,7 +826,6 @@ class VaultLockManagerTest { privateKey = privateKey, organizationKeys = organizationKeys, ) - vaultLockManager.completeUnlock(userId = USER_ID) assertEquals(VaultUnlockResult.Success, result) assertEquals( @@ -1362,7 +1360,6 @@ class VaultLockManagerTest { ), organizationKeys = organizationKeys, ) - vaultLockManager.completeUnlock(userId = userId) assertEquals(VaultUnlockResult.Success, result) coVerify(exactly = 1) { diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingViewModelTest.kt index 9be433dd2..36311ec44 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/landing/LandingViewModelTest.kt @@ -71,7 +71,6 @@ class LandingViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -204,7 +203,6 @@ class LandingViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -256,7 +254,6 @@ class LandingViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = false, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModelTest.kt index f4a8abd0e..3f7523070 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModelTest.kt @@ -127,7 +127,6 @@ class LoginViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModelTest.kt index 64e2fe399..f660fb9e7 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModelTest.kt @@ -116,7 +116,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -151,7 +150,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = true, organizations = emptyList(), @@ -729,7 +727,6 @@ private val DEFAULT_ACCOUNT = UserState.Account( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt index 1e1c56945..10cae5f68 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt @@ -46,7 +46,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = false, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -73,7 +72,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = false, isVaultUnlocked = false, - isVaultPendingUnlock = true, needsPasswordReset = true, isBiometricsEnabled = false, organizations = emptyList(), @@ -101,7 +99,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -114,36 +111,6 @@ class RootNavViewModelTest : BaseViewModelTest() { assertEquals(RootNavState.Auth, viewModel.stateFlow.value) } - @Test - fun `when the active user has a pending unlocked vault the nav state should be Auth`() { - mutableUserStateFlow.tryEmit( - UserState( - activeUserId = "activeUserId", - accounts = listOf( - UserState.Account( - userId = "activeUserId", - name = "name", - email = "email", - avatarColorHex = "avatarColorHex", - environment = Environment.Us, - isPremium = true, - isLoggedIn = true, - isVaultUnlocked = false, - isVaultPendingUnlock = true, - needsPasswordReset = false, - isBiometricsEnabled = false, - organizations = emptyList(), - ), - ), - ), - ) - val viewModel = createViewModel() - assertEquals( - RootNavState.Auth, - viewModel.stateFlow.value, - ) - } - @Test fun `when the active user has an unlocked vault the nav state should be VaultUnlocked`() { mutableUserStateFlow.tryEmit( @@ -159,7 +126,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -195,7 +161,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -235,7 +200,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -268,7 +232,6 @@ class RootNavViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt index e62fabde4..e73444c8d 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt @@ -974,7 +974,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt index 2996d2430..58e6e8477 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt @@ -192,7 +192,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, organizations = emptyList(), ), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorViewModelTest.kt index ff83dfcf2..b5f512a24 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorViewModelTest.kt @@ -1798,7 +1798,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendViewModelTest.kt index 51f8f8934..8b6b0c6c6 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendViewModelTest.kt @@ -1002,7 +1002,6 @@ class AddSendViewModelTest : BaseViewModelTest() { isPremium = false, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt index 873d8f702..c9760b45a 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt @@ -2174,7 +2174,6 @@ class VaultAddEditViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = false, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, organizations = listOf( Organization( diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt index 8d2734dca..2818b78bb 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt @@ -553,7 +553,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt index 8ed4c20e0..dba400be4 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt @@ -1497,7 +1497,6 @@ class VaultItemViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt index 442aae499..1ce52357d 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt @@ -1372,7 +1372,6 @@ private val DEFAULT_ACCOUNT = UserState.Account( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt index 5b6a96a9d..f866fa599 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt @@ -425,7 +425,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt index dc3920ba4..295d22350 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt @@ -94,7 +94,6 @@ private fun createMockUserState(hasOrganizations: Boolean = true): UserState = isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = if (hasOrganizations) { diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt index 963ac9318..d2e3ac5d0 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt @@ -162,7 +162,6 @@ class VaultViewModelTest : BaseViewModelTest() { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -1281,7 +1280,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -1295,7 +1293,6 @@ private val DEFAULT_USER_STATE = UserState( isPremium = false, isLoggedIn = true, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt index 144becd95..362829aec 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt @@ -69,7 +69,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -88,7 +87,6 @@ class UserStateExtensionsTest { isPremium = false, isLoggedIn = true, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -111,7 +109,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -134,7 +131,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = false, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -172,7 +168,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -208,7 +203,6 @@ class UserStateExtensionsTest { isPremium = false, isLoggedIn = true, isVaultUnlocked = false, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -248,7 +242,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf( @@ -276,7 +269,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = emptyList(), @@ -313,7 +305,6 @@ class UserStateExtensionsTest { isPremium = true, isLoggedIn = true, isVaultUnlocked = true, - isVaultPendingUnlock = false, needsPasswordReset = false, isBiometricsEnabled = false, organizations = listOf(