enhancement
major
minor
defect
critical
major
minor
major
#30109
tl-chat: After logging in, the chat in the same browser window remains at "Log in to use the chat"
Error
The chat feature in the React interface (<chat-conversation>, tl-chat module) displays the message “Sign in to use the chat” to a visitor who is not logged in, instead of showing the chat history and input field. If the user then logs in within the same browser window, the message remains: No input field appears, even after reloading the page. Only a new browser window (with a new window name) displays the chat.
Observed in tl-ai-demo (/view/, “Chat” page): Page opened while not logged in; logged in as “root” via “Log In”; the “Chat” page continues to display the login prompt.
Cause
After logging in, the window’s sub-session is retained; ViewServlet rebuilds the control tree for the new user. The new chat controls retrieve their ChatViewBinding (com.top_logic.ai.chat.view) from the sub-session’s cache (key BINDINGS), and the binding has hard-coded “authenticated,” the username, and the greeting name from the anonymous request in its constructor. As a result, the client continues to receive “authenticated=false.”
Solution
- ChatViewBinding no longer hard-codes the login status, username, and greeting name; instead, it reads them from the current user of the window every time the control state is written.
- Test: A binding that was created anonymously reports `authenticated=true ` and the account name after logging in within the same window.