Comments (1)
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.
from chat.io.
Related Issues (20)
- mongo HOT 3
- Integrate this into a web app
- Demo signup and login is not working HOT 1
- Production ready HOT 2
- auto logging without facing login screen HOT 1
- mongo error HOT 2
- use with android HOT 3
- not secure, current implementation passes username from frontend HOT 1
- Would please add some tutorials on how to connect this database HOT 1
- Support for emojis and pasting images
- save messages in database HOT 1
- Remove authentication HOT 1
- couldn't run the app HOT 1
- Facebook login doesn't work on the heroku live version. HOT 2
- express module not found .
- Express module not found. HOT 1
- Seems like mongolab doesn't exist as a seperate service
- real time texting (feature!)
- Private messaging HOT 1
- room into error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat.io.