Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store messages when the sender/recipient is offline and send them when online. #19

Open
FrazerSeymour opened this issue Feb 19, 2018 · 4 comments

Comments

@FrazerSeymour
Copy link
Contributor

Currently meshIM users can only send messages when both parties are online, and if either party disconnects unexpectedly messages can be in a weird state where they are considered sent but never received.

Once "message received" events are in RightMesh, we need to save whether or not a message has been received, and attempt to resend once both parties are online.

@FrazerSeymour
Copy link
Contributor Author

I'm envisioning an extra boolean "sent" column in the Messages table, and some query like SELECT * FROM Messages WHERE Sent = 0 AND MeshID = :meshId that can be run when on the PeerDiscoveredEvent.

@FrazerSeymour
Copy link
Contributor Author

I'm not sure if we should store a separate timestamp for when a user pressed "send" on the message and when the message actually sent, if there's a value to that or not.

@compscidr
Copy link
Contributor

A subsequent "version" of this would be when @sriks1 has the merge request in the library ready for delivery confirmation. Then it would also be possible to resend data if the user goes offline before you get a received event. Perhaps this is something better handled by the library in the long run though - when you call a sendReliable, the library internally stores the data stream in a db until the received event is confirmed, it retries when a meshid goes offline. then from the app dev perspective, just hitting send always gets it there every time, despite online / offline drops.

@FrazerSeymour
Copy link
Contributor Author

Yeah it will eventually be replaced as RightMesh functionality, but for now this is a good end-user functionality.

Good thought on the delivery confirmation point. 👍 Right now it would just be considered "sent" on sendDataReliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants