Closed debanjum closed 6 months ago
I took a second look at the code. The method aget_conversation_by_user
, which is in the hot path for the /chat/
endpoint hasn't been updated. For that one, it'll still create a new conversation if/when the conversation_id
doesn't come back with a match.
I took a second look at the code. The method aget_conversation_by_user, which is in the hot path for the /chat/ endpoint hasn't been updated. For that one, it'll still create a new conversation if/when the conversation_id doesn't come back with a match.
Great catch! Fixed in #677
Issue
Previously deleting a chat session from the side panel on desktop, web app would sometimes result in also creating a new chat session
Fix
get_conversation_by_user
shouldn't return new conversation if conversation with requested id not found.It should only return new conversation if no specific conversation is requested and no conversations found for user at all
Miscellaneous Improvements
Repro
Delete a new chat, this calls loadChat via window.onload which calls server /chat/history API endpoint with conversationId set to that of just deleted conversation sporadically
The call to GET chat/history API with conversationId set occurs when window.onload triggers before the conversationId is deleted by the delete button after the DELETE /chat/history API call (via race)
In such a scenario, get_conversation_by_user called by chat/history API with conversationId of deleted conversation returns a new conversation