[lib] Fetch thick thread messages
Summary:
Use the same mechanism as we use for the thin threads.
The change in message reducer is necessary because persisting the information about startReached status to SQLIte causes a bug where after refreshing the app we don't try to fetch messages ever again. An alternative solution would be to filter the status out on the DB layer, but I think this one is a lot cleaner.
https://linear.app/comm/issue/ENG-8706/modify-message-lists-to-call-the-new-function
Depends on D13147
Test Plan:
On web:
Created a thick thread with 100 messages. Closed and reopened the app, scrolled up, and made sure all 100 messages are displayed.
There are two issues though:
- We don't stop after fetching the first batch. Instead, we're fetching all the batches one by one immediately. - created an issue to track https://linear.app/comm/issue/ENG-9097/fetching-new-messages-in-message-list-is-glitchy-when-it-happens
- The robotext about creating a thread isn't fetched when there are more than defaultNumberPerThread messages. - fixed. The issue was that we were always throwing away the last message, even in the last batch.
On native:
Created a thick thread with 100 messages. Closed and reopened the app, scrolled up, and made sure all 100 messages are displayed. This time issue 1. from the web isn't present because fetching (or updating the UI) is a lot slower.
Reviewers: kamil, inka
Reviewed By: kamil
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13162