osPrims / chatApp

A chatroom based web application built using Express.js and Socket.IO
https://chatapp-wuhy.onrender.com/
MIT License
22 stars 52 forks source link

receiving all the chat messages again and again and it's maybe due to some issue with socket.io #189

Closed ozair-dev closed 1 year ago

ozair-dev commented 1 year ago

So I signed in with my account and left the website open for a while and noticed a problem. I saw that after every few minutes, the chat shows a message that a new user has connected, and all messages (and I mean all of em from start to bottom) are appended again to the chat which should not happen, and whats weird is that the new recognized user is in fact me. So it thinks that i have reloaded the page or something and it gets all the messages again. Why is this showing the new user (which is me) connected message when I didn't even left the chat and neither did I reload the page. And it keeps happening unlimitedly.

In the screenshot, you can see that it is showing my name multiple times in the online people list, and also in the console it is logging all the messages again and again after few minutes which means it is receiving all messages again and again

Screenshot from 2022-10-11 22-03-19

Hope I explained the issue clearly.

I think it has something to do with socket.io. I can dig into this issue if you want me to.

If you understand the issue, and want me to work on it, then assign it to me.

Steps to reproduce the issue:

osBins commented 1 year ago

Good fine @ozair-dev. Thanks for pointing this out. Assigning this issue to you.