You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm using a custom frontend repo and chainlit/react-client lib to establish a WebSocket connection with Chainlit. The issue is that the X-Chainlit-Thread-Id header doesn’t update as expected when I try to set a old thread ID dynamically through idToResume. The header only updates correctly if the page is refreshed. Without a refresh, the header retains an old value or fails to set the new thread ID, resulting in a new connection without the intended idToResume value in the header.
According to my understanding :
IdToResume hook sets the X-Chainlit-Thread-Id header and setIdtoResume from chatInteract can be used to set IdToResume.
Accordinglt whenever IdToResume changes sessionstate recoil state(if you are using one) should get updated right? but it only happens when i reload/refresh the page.
To Reproduce
Steps to reproduce the behavior:
Open the custom frontend and initiate a WebSocket connection with a specific idToResume set in the headers.
Click on an item or perform an action that updates idToResume and should trigger a new WebSocket connection with the updated X-Chainlit-Thread-Id.
Observe that the header does not update as expected and either has an empty X-Chainlit-Thread-Id or retains the old value.
Refresh the page and note that the header is then correctly updated with the intended idToResume.
Expected behavior
The X-Chainlit-Thread-Id header should update dynamically whenever idToResume is changed, without requiring a page refresh to set the new thread ID properly in the WebSocket connection.
I am looking for guidance on the best way to dynamically set X-Chainlit-Thread-Id without refreshing the page each time idToResume is updated. Is there a recommended way to ensure the WebSocket connection uses the updated idToResume header immediately upon reconnecting?
I tried using clear() and disconnect but still facing difficulties in trying to get the header updated when reconnecting to the old chat using Idtoresume hook, though the same functionality works when i reload the page.
The text was updated successfully, but these errors were encountered:
This improves Socket.IO configuration and CORS handling for cross-origin use cases,
particularly focusing on scenarios where Chainlit is embedded in other websites (copilot, closes#1279) or deployed behind load balancers:
- Make Socket.IO client transports configurable via `project.transports` setting
- Move connection parameters from headers to Socket.IO auth object for better
websocket compatibility
- Update CORS handling to properly support authenticated cross-origin requests. Closes#1359.
- Remove unnecessary task start/end events from window_message handler
BREAKING CHANGE: For cross-origin deployments, wildcard "*" is no longer supported
in allow_origins when using authenticated connections. Specific origins must be
listed in the project config.
Possibly resolves#719, #1339, #1369, #1407, #1492, #1507.
Describe the bug
I'm using a custom frontend repo and chainlit/react-client lib to establish a WebSocket connection with Chainlit. The issue is that the X-Chainlit-Thread-Id header doesn’t update as expected when I try to set a old thread ID dynamically through idToResume. The header only updates correctly if the page is refreshed. Without a refresh, the header retains an old value or fails to set the new thread ID, resulting in a new connection without the intended idToResume value in the header.
According to my understanding :
IdToResume hook sets the X-Chainlit-Thread-Id header and setIdtoResume from chatInteract can be used to set IdToResume.
Accordinglt whenever IdToResume changes sessionstate recoil state(if you are using one) should get updated right? but it only happens when i reload/refresh the page.
To Reproduce
Steps to reproduce the behavior:
I am looking for guidance on the best way to dynamically set X-Chainlit-Thread-Id without refreshing the page each time idToResume is updated. Is there a recommended way to ensure the WebSocket connection uses the updated idToResume header immediately upon reconnecting?
I tried using clear() and disconnect but still facing difficulties in trying to get the header updated when reconnecting to the old chat using Idtoresume hook, though the same functionality works when i reload the page.
The text was updated successfully, but these errors were encountered: