langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Chat session in Playground does not refresh.

Open greenmotion opened this issue 1 year ago • 1 comments

Bug Description

The chat session in the playground does not automatically refresh. I can submit a question to the chatbot and hit send, but the chat session will not show me the response, until I switch to another window and switch back and/or close playground and re-open it. In other words, it seems it only refreshes when the browser window gets refocused. Tried this on Mozilla and Brave (chrome)

Reproduction

  1. In a chatbot workflow, open playground
  2. type a question, hit send
  3. one the send button stops showing "stop", no response is displayed in the chat.
  4. Navigate away and go back to your browser window and/or leave playground and go back in, and now you can see the response.

Expected behavior

Upon hitting send, a response should automatically be displayed in the chat session.

Who can help?

No response

Operating System

Ubuntu LTS 20.24

Langflow Version

1.1.0

Python Version

3.12

Screenshot

No response

Flow File

No response

greenmotion avatar Nov 22 '24 14:11 greenmotion

The issue you're experiencing with the chat session not automatically refreshing in the Langflow Playground might be related to how the frontend handles real-time updates or re-renders. Langflow uses WebSocket communication to update the chat interface in real-time. The handleWsMessage function processes incoming WebSocket messages and updates the chat history, which should trigger re-renders of the chat interface [1].

Additionally, there is an event listener for visibility changes in the browser that resets certain states when the tab becomes visible again [2]. This might be affecting the refresh behavior you're observing.

To troubleshoot, you might want to check if the WebSocket connection is being established correctly and if the handleWsMessage function is processing messages as expected. Also, ensure that there are no issues with the state management that could prevent the chat interface from updating in real-time.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Nov 22 '24 14:11 dosubot[bot]

hey @greenmotion, I've tried the main branch and couldn't reproduce the issue, how are you running langflow exactly? are you using docker or something similar?

anovazzi1 avatar Nov 25 '24 17:11 anovazzi1

Thank you for your contribution! This issue will be closed. If you have any questions or encounter another problem, please open a new issue and we will be ready to help you.

carlosrcoelho avatar Nov 29 '24 18:11 carlosrcoelho

I met the same issue with langflow 1.2.0, but langflow 1.1.1 doesn't have this issue.

quic-zhanweiw avatar Mar 08 '25 05:03 quic-zhanweiw