-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend/react-client does not resume session after backend connection loss #828
Comments
I face this error too. This happens frequently for Cloud-hosted servers with auto-scaling. I've traced the root cause to this:
Possible solutions:
@tpatel, what do you think? I can open a new PR for this fix. |
@qtangs, my analysis of the problem found the same root cause. However, I don't think your suggested solutions will work. A possible solution would be to listen on the |
@qvalentin you're right. Using I've tested this addition of the update after useChatSession.ts#L68 and verified that it works:
|
Great, will you open a PR? |
Yeah, I'm planning to do that when time permits. Will need to add some test cases too |
Please submit a PR! |
…th currentThreadId to ensure session continuation after backend restart
PR is created, pls review. |
Update websocket's thread id header with currentThreadId to ensure session continuation after backend restart.
Hey, just wanna know. is it fixed? I was facing a similar issue related to X-Chainlit-Thread-id being not set properly even after using clear(), using setIdtoResume() while resuming to the old chat?. What will be the best way of doing so. The values are getting updated if i refresh it but not when i set it before making reconnection. Any help?? |
Describe the bug
We use a chainlit setup with chat_persistence and on_chat_resume.
If we start a chat with one message, then cause a websocket disconnect by, for example, restarting the backend,
and then write another message once the reconnect happened, both messages will be persisted in two different sessions.
This can be reproduced with the integrated chainlit frontend.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be one persisted chat session with both messages in it
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: