fix(profiles): connection-profile switch re-dials the WebSocket (#888)

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57
2026-08-12 23:27:08 +03:00
committed by GitHub
co-authored by M57
parent 546bd17b18
commit 683a24becf
10 changed files with 183 additions and 17 deletions
@@ -106,6 +106,7 @@ class ChatUpdateCommandTest {
// collectors park harmlessly.
mockkObject(ProfileSwitchCoordinator)
every { ProfileSwitchCoordinator.switched } returns MutableSharedFlow<String>()
every { ProfileSwitchCoordinator.connectionSwitched } returns MutableSharedFlow<String>()
every { HermesWsClient.send(any(), any(), any()) } answers {
reqCount++
@@ -126,6 +126,7 @@ class ChatViewModelTest {
every { AuthManager.getSelectedProfileId() } returns null
mockkObject(ProfileSwitchCoordinator)
every { ProfileSwitchCoordinator.switched } returns mockSwitchFlow
every { ProfileSwitchCoordinator.connectionSwitched } returns MutableSharedFlow<String>()
every { AuthManager.isTypingEffectEnabled() } returns true
every { AuthManager.getTypingEffectDelayMs() } returns 30
every { AuthManager.isAutoReconnect() } returns false
@@ -84,6 +84,7 @@ class SlashCommandDispatchRpcTest {
// pattern) so the collectors park harmlessly.
mockkObject(ProfileSwitchCoordinator)
every { ProfileSwitchCoordinator.switched } returns MutableSharedFlow<String>()
every { ProfileSwitchCoordinator.connectionSwitched } returns MutableSharedFlow<String>()
app = mockk(relaxed = true)
fakeRepo = FakeChatPersistenceRepository()