Skip to content

Latest commit

 

History

History
5 lines (4 loc) · 1.73 KB

JOURNAL.md

File metadata and controls

5 lines (4 loc) · 1.73 KB

Date - 17.02.2024 - First Big Problem faced about the messages component

  • [~] Conversation page problem: Everything works fine but when someone sends message through the websocket, the websocket also works as it is supposed to, but the message is showing up on the other chats the receiving user joined in. Upon clickin on the chat card, the chat page works perfectly fine, the websocket joins every user to that specific chat room and every messages stay in that chat only. But the problem is how I manage the state of each messages locally using the redux store. I need to make sure that the messages should only be shown on the specific chat room.
  • [~] Problem on managing the state: Actually the problem persists on the local state which I manage by redux-store. The slice is located at client/src/utils/store/slices/messages.slice.ts, from which i grab the global state and store in the local state using the useState and upon each messase request whether it contains any attachment or not it first got updated in the local state along with the global state but the display of real-time updates is made on top of the local state which is the main reason of the anomaly.
  • [~] Probable fix: The probable fix would be if some how i can manage to store the local state just like i store the global state using redux-store, in that case I need make sure every thing works fine with the change made to the local state, not only I have to change the structure of the local state I also have to change how eveything uses the loca state becasue they were made to use the old structure. And last but not the lease the code file itself is 500 lines long I have to work carefully oherwise I may damage the repository