[lib] Update the replies count
Summary:
- Get all the updated threads from the updates.
- Group the threads and get the most recent one - some specs can generate multiple thread updates, and we want to have the thread from the last update, because this thread is the most recent and will end up being put into Redux and DB.
- Count the messages.
- Generate a new update with an updated thread by increasing its replies count.
https://linear.app/comm/issue/ENG-8930/unify-the-approach-to-replies-count-and-unread-status-updates
Depends on D13058
Test Plan: Tested change thread setting and send text message operations. Verified that only send text message operation bums the replies count.
Reviewers: kamil, inka
Reviewed By: inka
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13059