Use persistable sessions instead of context #1513
Labels
architecture
Overall project architecture.
auth
Pertaining to authentication.
backend
Pertains to the Python backend.
enhancement
New feature or request
frontend
Pertains to the frontend.
needs-triage
Is your feature request related to a problem? Please describe.
A lot of information regarding the user's session is currently stored in context variables. This means that all of this information is currently stored on a smaller-than thread level. That means that our chainlit daemon is stateful -- it's basically stored 'on the websocket'.
This effectively prohibits running multiple instances of chainlit behind a load balancer, as any reconnect will cause the session to be lost.
Describe the solution you'd like
Maintaining state explicitly and reduce state wherever possible.
Describe alternatives you've considered
The alternative is to maintain state fully on the client side and remove all state server-side -- so each request sends the full state to the server. This is more REST-ful but it's a huge leap and requires careful assessment of security implications.
Something like a cookie signed by the JWT.
Additional context
Related issues:
Related resources
The text was updated successfully, but these errors were encountered: