Description
As a user
I want to have chat synced in order
So that the most relevant messages are received in a shorted time interval
Description
Currently once a user goes back online, we fetch all the topics for all the chats in one go.
We should improve the way syncing works by being selective on which chat to sync first.
In order of importance we should sync:
- The chat the user is in when opening the chat, depends on Re-open app on the last open chat #12782
- Last community channel the user was in
- Fetch messages from all community channels the user has visited in the past 7 days
- Fetch all 1-to-1 and ad-hoc group chats
- Fetch messages from all community channels the user has not visited in the past 7 days
- Fetch public unmoderated group chats (with the understanding that this 5th step will be removed as soon as we remove public unmoderated group chats from the product)
Considerations
Some of these only make sense if the interval we are syncing is large enough (1 seems to be almost always a good choice, but after that we probably want to make sure it's worth the overhead, i.e if you are syncing 2 minutes of data, is most likely better to just sync everything in one go, as opposed if you are syncing a couple of hours).
The goal of this issue is to improve syncing, to bring the most relevant messages to the user as quickly as possible, so we should re-evaluate as we go along that it is indeed making things faster, and tests need to be performed with a device with many chats/contacts.