Skip to content

fix: respect message_limit when querying the db - #3908

Merged
isekovanic merged 1 commit into
V10from
fix/broken-pagination-with-offline-race-condition
Oct 29, 2026
Merged

isekovanic merged 1 commit into
V10from
fix/broken-pagination-with-offline-race-condition

Conversation

@isekovanic

Copy link
Copy Markdown
Contributor

🎯 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 . 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 (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

@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 2037 KB 2020 KB -17841 B πŸš€
ai_components_size 163 KB 163 KB -16 B πŸš€

@isekovanic
isekovanic merged commit cd9f539 into V10 Oct 29, 2026
2 checks passed
@isekovanic
isekovanic deleted the fix/broken-pagination-with-offline-race-condition branch October 29, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants