Bug: Server state not updating when switching servers #69
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#97
Original Author: @icub3d
Original Date: 2026-04-18T22:18:09Z
Overview
When a user clicks a different server in the sidebar, the application updates the UI to show the new server name but does not actually switch the connection or update the channels and messages to reflect the new server's state. The app remains connected to the previous server.
Background
The
shouldAutoConnectlogic inclient/src/hooks/useAccountManager.tswas preventing new connections if the application was already in aconnectedstate, even if the target server changed. Additionally,useServerStore.connectdid not explicitly disconnect from the previous server when a new connection was requested.Requirements
shouldAutoConnectshould allow connection if the target server differs from the current address.useServerStore.connectshould disconnect from the current server before connecting to a new one if the address is different.Design
client/src/hooks/useAccountManager.tsto include current address in comparison.client/src/App.tsxto pass the address to the hook.client/src/stores/serverStore.tsto calldisconnect()at the start ofconnect()when switching addresses.Task List
shouldAutoConnectlogic to handle server switching.shouldAutoConnectinApp.tsx.serverStore.connectto handle cleanup of previous connections.Test List
shouldAutoConnectwith different server addresses.