Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.flipcash.app.push.PushTokenProvider
import com.flipcash.app.tokens.TokenCoordinator
import com.flipcash.app.userflags.UserFlagsCoordinator
import com.flipcash.shared.profile.ProfileCoordinator
import com.flipcash.services.chat.WrongKeyChats
import com.flipcash.services.controllers.AccountController
import com.flipcash.services.controllers.ProfileController
import com.flipcash.services.controllers.PushController
Expand Down Expand Up @@ -60,6 +61,7 @@ class AuthManager @Inject constructor(
private val profileCoordinator: ProfileCoordinator,
private val contactCoordinator: ContactCoordinator,
private val chatCoordinator: ChatCoordinator,
private val wrongKeyChats: WrongKeyChats,
private val networkObserver: NetworkConnectivityListener,
private val dispatchers: DispatcherProvider,
// private val analytics: AnalyticsService,
Expand Down Expand Up @@ -440,6 +442,7 @@ class AuthManager @Inject constructor(
userFlags.clearAll()
profileCoordinator.reset()
userFlags.resetCache()
wrongKeyChats.reset()

if (!BuildConfig.DEBUG) TraceManager.userId = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.flipcash.app.tokens.TokenCoordinator
import com.flipcash.app.userflags.UserFlagsCoordinator
import com.flipcash.shared.chat.ChatCoordinator
import com.flipcash.shared.profile.ProfileCoordinator
import com.flipcash.services.chat.WrongKeyChats
import com.flipcash.services.controllers.AccountController
import com.flipcash.services.controllers.ProfileController
import com.flipcash.services.controllers.PushController
Expand Down Expand Up @@ -72,6 +73,7 @@ class AuthManagerTest {
private val profileCoordinator: ProfileCoordinator = mockk(relaxed = true)
private val contactCoordinator: ContactCoordinator = mockk(relaxed = true)
private val chatCoordinator: ChatCoordinator = mockk(relaxed = true)
private val wrongKeyChats: WrongKeyChats = mockk(relaxed = true)
private val userManagerState = MutableStateFlow(UserManager.State())

private val networkConnectivityListener = mockk<NetworkConnectivityListener>(relaxed = true)
Expand Down Expand Up @@ -122,6 +124,7 @@ class AuthManagerTest {
profileCoordinator = profileCoordinator,
contactCoordinator = contactCoordinator,
chatCoordinator = chatCoordinator,
wrongKeyChats = wrongKeyChats,
dispatchers = dispatchers,
networkObserver = networkConnectivityListener,
)
Expand Down Expand Up @@ -258,6 +261,8 @@ class AuthManagerTest {
verify { featureFlagController.reset() }
verify { appSettings.reset() }
verify { userFlags.clearAll() }
// A wrong-key mark is keyed by chat id alone, so the next account must not inherit it.
verify { wrongKeyChats.reset() }
}

@Test
Expand Down
Loading
Loading