impowski
12/28/2018, 8:55 PMSubscription
method receiveMessages
which sends me new messages when they are created and a Query
method getMessages
which utilises Connection
with cursor-based pagination.
So, when a user log in into an application, he opens chat and have some messages in cache and then receiving other other messages which he missed. We take the latest available message in cache and pass it to our getMessages
method and get everything after that message. And if we scroll back to top, it will load with the same method 10 previous messages before last message on the screen at the top.
And the problem which I’m trying to figure out is the possibility of loosing any messages on receive when some sort of disconnecting happened on the client side.
If anyone could help me out and describe the proper flow for such application I would be glad to hear it out!🙏Harshit
12/29/2018, 8:25 AM