You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This already is almost done by Socket.io, but, there are pitfalls.
If two users are chatting together; userA and userB. If userA lost the internet connection, the socket will detect there is a disconnection and will try to reconnect when the connection is up again. Now, any messages that will be sent by userA will be buffered and transmitted to all other active sockets when it's possible.
The problem is, any messages that will be sent by userB during the disconnection, won't be delivered to userA after reconnecting successfully, Why? On re-connection, a new socket will be created, with a new id, and will join the room again, and when userB tried to send messages to all active sockets while userA was disconnected, the newly created socket(created after re-connection) wasn't included across active sockets.
The solution might be for userA has to ask for the messages sent by all users in the chatroom while disconnection. Therefore, the messages has to be stored somewhere for later fetching.
For this chat application, I don't store messages, So, it's hard to achieve this, but, can be implemented in the future.
Hi,
I've seen this today on reddit and looks like a great project, does it have or will have sometime offline support for messages?
Thanks,
Keep up the good work!
The text was updated successfully, but these errors were encountered: