talk-android
talk-android copied to clipboard
Load messages and conversation in background when push message is received
when a push message is received
- the offline messages should be updated immediately
- the offline conversations should be updated immediately in background.
So when entering the chat, there is no need to fetch messages from server but the initial loading from server can be skipped. This will improve user experience when entering a chat as it feels like everything is already in place and doesn't have to be loaded. Also, this will be useful to have data offline as soon as possible in case the connection is lost.
This will require to move some logic from OfflineFirstChatRepository to ViewModel or a DomainModel so the Repository can also be used from NotificationWorker.
- [ ] discuss if fetching messages and conversations for every push message is causing too much load for the server?
- [ ] is fetching conversation list necessary? Clicking notification directs to the chat and skips the conversation list