#281 — [Bug]: Cross talk between tenants chat histories

Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned

Created: 2025-01-28 · Updated: 2025-09-15

Description

Steps to reproduce

  1. In staging log in to the platform with two different users at the same time
  2. Make sure you are on chats with the same chat_id (you can check the URL) on both accounts
  3. Say your name in one chat
  4. Ask what your name is on the other chat. You’ll get the information from the previous one.

Expected behavior

Both histories should be separate

Actual behavior

There is cross talk:

Image

The source of the issue is here:

https://github.com/Twill-AI/facade/blob/9c2e05dbf420a0dd7fdfd92b55660f111f257168/app/api/ws_connection_manager.py#L587

There is a chat history cache that is indexed by chat_id but this number is sequential by tenant so two tenants will get chat ids 1,2,3,4,5,6 … If two people happen to be chatting using the same id’s close in time (so that data is retrieved from the cache instead of the DB) there is cross talk.

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets