Unfortunately, I am no longer able to reproduce the original issue from the task description (even using the same account and backup), but because of my observations when creating the task, I was able to find the issue.
Steps to reproduce:
- Send more than 20 messages in thin thread.
- Restore backup and add sleep when reading content from User Data.
- There is no UI yet, so before dispatching data from backup, you can see all messages in this thin thread.
- After data from the backup is dispatched, there are only 20 messages.
This is because getClientDBStore, for thin threads, returns only 20 messages and setClientDBStoreActionType is overriding all previous messages.
This diff fixes this, for messageStore.threads this is handled correctly in here.
This issue is not occurring for other reducers, because for other data types we read everything as part of getClientDBStore, only for messages we read a subset.