Repository navigation
fix: offline message limit pagination - #3907
Merged
Merged
Conversation
Contributor
SDK Size
|
szuperaz
approved these changes
Oct 28, 2026
This was referenced Oct 28, 2026
isekovanic
added a commit
that referenced
this pull request
Oct 29, 2026
## π― Goal Fixes #3903 on V10. This is the V10 port of #3907. Linear ticket: https://linear.app/stream/issue/RN-471/offline-support-channels-hydrated-from-the-local-db-get-hasprev-false ## π Implementation details - Channels loaded from the offline DB can look fully loaded when the server still has older messages, so scrolling up never loads them. The offline DB returns at most 24 messages per channel and ignores the list's `message_limit`. Fixed in `selectMessagesForChannels` together with <LLC PR link>. The offline DB now returns the newest `message_limit` messages per channel (25 when not set), and the client reads that page against the same limit. - The offline DB can show messages with gaps between them. If messages 1-10 were cached in one session and 16-25 in a later one, they show up back to back with 11-15 missing. Fixed by the same change, since only the newest `message_limit` messages are read now. The other two fixes from #3907 aren't needed on V10. The lists call `loadMore()` directly, without per-length trackers that a failed request could leave stuck. `MessageFlashList` already loads older messages from its initial scroll event. ## π¨ UI Changes / ## π§ͺ Testing / ## βοΈ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
Contributor
|
π This PR is included in version 9.11.1 π The release is available on:
Your semantic-release bot π¦π |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π― Goal
Fixes #3903 and the related pagination problems found while testing it.
Linear ticket: https://linear.app/stream/issue/RN-471/offline-support-channels-hydrated-from-the-local-db-get-hasprev-false
With offline support, channels hydrated from the offline DB could end up with
hasPrev = falseeven when the server has older messages, so scrolling up never requests them. The offline DB returns at most 24 messages per channel (RowNum < 25).Testing it also showed that the message lists stop paginating after a single failed request and that
MessageFlashListcannot load older messages when the loaded ones do not fill the screen.π Implementation details
hasPrev = falsewhen the server still has older messages, so scrolling up never loads them. The offline DB returns at most 24 messages per channel and ignores the list'smessage_limit, so the client reads a short cached page as the start of the channel. Fixed in 06e1be3, together with fix: read cached channels against the query's message_limitΒ stream-chat-js#1958. The offline DB now returns the newestmessage_limitmessages per channel (25 when not set), and the client reads that page against the same limit.message_limitmessages are read now.MessageListandMessageFlashListstop paginating until the number of messages changes.loadMore,loadMoreRecentandloadMoreThreadswallow their errors, so the lists treat the failure as a successful load. Fixed in 65b9bf5, so if a load adds nothing the list tries again on the next scroll after a 2 second backoff.MessageFlashListcan't load older messages when the loaded ones don't fill the screen, because it only paginates on scroll events and a list that short can't scroll. Fixed in 7e6b5e7 with the same prefillMessageListhas.π¨ UI Changes
/
π§ͺ Testing
/
βοΈ Checklist
developbranch