Skip to content
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

Use userSessionId for chat history #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjiampojamarn
Copy link
Contributor

@sjiampojamarn sjiampojamarn commented Jul 14, 2024

Currently, all chat history (library) is global for all users. This PR separates them with userSessionId so the history (library) appears within the user sessions.

High-level logics:

  • Add a new column userSessionId in the chats table to indicate the chat owner.
  • In the UI, ChatWindows, userSessionId is created or looked up from the localstroage.
    • Send userSessionId to the WebSocket so that the chat record is created along with the userSessionId.
  • In the UI, Library page, userSessionId is created or looked up from the localstroage.
    • Send userSessionId to api/chats in the header to get the chat history
  • In the backend, chats API picks up the userSessionId and queries DB only for chats belonging to userSessionId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant