-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement pagination in the chat #2196
Comments
@elatif2020 I think it's bad approach. Usually, we fetch number of messages depends on screen height, maybe 1.5 or 2 times more than screen height |
Also telegram and other messages works the same |
For scroll to message, I believe we need backend API for calculate this - how much pages we should fetch to this message |
@MeyerPV
|
exponential growing can be reason of slow performance. I find a solution without touching BE and exponential grow We can get message createdAt date and fetch by condition all messages which below to it |
let's wait with this ticket |
@MeyerPV Updating that we want to move forward with this ticket. Could be good if you can start soon, maybe tomorrow morning once you're done with current tickets? |
Sure |
@MeyerPV Notice that we should implement it in a way that will support (afterward) preloading chat messages at the page level. See the discussion in common here |
@elatif2020 As I understand correctly to fetch messages at the middle of the list for looking at replies? Like a - I'm at page 1 but reply at page 10 and I show only page 10, instead of fetching 2,3,4 ...., correct? |
yes if it possible as you wrote without BE |
Implement pagination in the chat #2196
Load first ~10 messages and render them (to show the first screen).
And after the screen loads request a batch of more 40 messages upward.
Request the next batch once the user starts to go up (above the first 10 messages), and if she reach the upmost loaded message show a loader (after 1 second delay) until it's rendered.
For now if a user clicks a link to message which is above the current messages loaded - I suggest to load the next 200 messages first, and if it's not there the next 800 messages (so each time *4 the previous batch)
Should be implemented with subscription (at least for the latest messages) and preferably in a way that uses Firebase's offline persistent capabilities (so use cached data if possible).
We need this both for discussions and for dm's.
The text was updated successfully, but these errors were encountered: