Closed Tizzz-555 closed 6 months ago
Thank you for reporting this issue, let me think about it.
Sure thing! Let me know 🙏
@PradyumnaKrishna Were you able to check this out? Can you replicate the bug on your end? I worked on it a bit yesterday and found a workaround, I would like to show you
@PradyumnaKrishna Were you able to check this out? Can you replicate the bug on your end? I worked on it a bit yesterday and found a workaround, I would like to show you
Yeah sure show me.
I was thinking what if the client can verify all the public keys and users, when the browsers loads the chat. Or, verify the public key and user when someone open the that chat.
In the list of my chats, I have 4 chats now, 3 that I just created today and 1 that has been automatically saved from a previous session. This last one crashes the app with this error when clicked:
Here we crash if given an invalid key. Our expired chat doesn't have a cookie associated with it anymore, therefore its
publicKey
value isnull
.Proposal:
1. Graceful Error Handling:
Before using the publicKey in any operations, check if it's valid. If it's not valid (e.g., null or not a string), handle the error gracefully:
2. Cleanup or Repair:
When loading the chat list, cross-check each chat session with the cookies. If a chat session doesn't have an associated cookie (or the cookie has an invalid value), remove it from the chat list.