offline: Keep persisted channel lastMessageAt consistent with its latest message - #6623
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesChannel timestamp mapping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|



Goal
Backport of #6621 to
v6. Channels could be sorted by a stalelastMessageAtwhen the persisted value lagged the channel's newest visible message, so a row would show a newer message than its position in the list reflected.Original issue: #6604
Implementation
When persisting a channel, keep
lastMessageAtconsistent with its last message instead of trusting the stored field, so it never lags behind (nor regresses below) the newest visible message. Same change as #6621, applied tostream-chat-android-offlinewhere the mapper lives on this branch.Testing
ChannelMapperTest: added coverage for advancing to a newer message, not regressing when the stored value is newer, and the no-last-message case; updated the existing mapping test.spotlessCheck,detekt,apiCheck(no public API change), and the offlinetestDebugUnitTestsuite pass.Summary by CodeRabbit