The connection flow is responsible for establishing and managing a persistent WebSocket connection to a discovered chat server. Once authentication completes and an access token has been obtained, the application constructs a ClientManager, which coordinates connection initiation, message routing, and model setup.
This flow is triggered automatically by each chat window (or tab) that is opened by the user. Each chat window maintains its own ClientManager instance, which encapsulates the connection and user-specific state for that context.
connectToServer()
to initiate the WebSocket handshakeconnected
signal is emittedactiveChannelsReady
Each active chat window in the application owns a dedicated instance of ClientManager. This allows isolated connection handling per window or tab and ensures that each session can maintain its own filtered views, JWT identity, and connection lifecycle independently.
See also authenticationflow.html, discoveryflow.html, and ClientManager.