Skip to content

Comments

Fix pagination issue caused by missing fillTheGap call#6055

Merged
aleksandar-apostolov merged 4 commits intodevelopfrom
bug/AND-966_fix_pagination_issue_by_missing_fillthegap
Dec 22, 2025
Merged

Fix pagination issue caused by missing fillTheGap call#6055
aleksandar-apostolov merged 4 commits intodevelopfrom
bug/AND-966_fix_pagination_issue_by_missing_fillthegap

Conversation

@VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Dec 22, 2025

🎯 Goal

We need to call fillTheGap even on regular pagination, because we could have previously upserted a message out-of-order in the list (from a WS event). So fill the gap is required to fill the missing messages between the loaded messages, and the out-of-order upserted message.

Note: This is just a revert of a recently introduced regression, it will be fixed properly in the next regular release.

🛠 Implementation details

Revert the change from this optimisation PR

🧪 Testing

  1. Open channel (don't paginate)
  2. From a different device/user, pin a message from the 3rd page of the same conversation
  3. From the first device, scroll until the new pinned message is loaded
  4. There should be no gap in the messages

Summary by CodeRabbit

  • Bug Fixes
    • Fixed gaps in message lists caused by out-of-order insertions by ensuring gap filling runs consistently after successful online message queries.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.60 MB 10.60 MB 0.00 MB 🟢
stream-chat-android-compose 12.81 MB 12.81 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar marked this pull request as ready for review December 22, 2025 09:48
@VelikovPetar VelikovPetar requested a review from a team as a code owner December 22, 2025 09:48
@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Unconditionally runs the gap-filling routine after successful online channel queries in ChannelLogic.runChannelQuery, removing the previous check that limited gap-filling to around-ID pagination. Adds a changelog entry documenting the fix.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Adds entry under stream-chat-android-state describing fix for message-list gaps caused by out-of-order message insertion
Gap-filling logic
stream-chat-android-state/src/main/java/io/getstream/chat/android/state/plugin/logic/channel/internal/ChannelLogic.kt
Removed conditional guard so fillTheGap is invoked for all successful online queries (previously only when isFilteringAroundIdMessages was true)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus review on ChannelLogic.runChannelQuery change and ensure unconditional gap-filling doesn't introduce regressions or performance issues.
  • Check related pagination and caching behavior that may interact with gap-filling logic.

Poem

🐰 Hopping through the message stream so bright,
I stitched the gaps back into light.
No more messages lost in play,
All in order — hip hooray! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a pagination issue by restoring the fillTheGap call, which is clearly the primary objective of this PR.
Description check ✅ Passed The PR description includes key sections (Goal, Implementation details, Testing) with sufficient detail about the issue, solution, and reproduction steps, though it lacks some optional sections like UI Changes and contributor checklist completeness.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/AND-966_fix_pagination_issue_by_missing_fillthegap

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 352900e and 2750376.

📒 Files selected for processing (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: compare-sdk-sizes / Compare SDK sizes
  • GitHub Check: Build / compose apks
  • GitHub Check: Unit tests
  • GitHub Check: Debug build
  • GitHub Check: API check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@aleksandar-apostolov aleksandar-apostolov merged commit fd46598 into develop Dec 22, 2025
13 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the bug/AND-966_fix_pagination_issue_by_missing_fillthegap branch December 22, 2025 11:42
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.

2 participants