Ensure SyncManager respects messageLimit and memberLimit when restoring channel queries#6231
Conversation
…ng channel queries Co-Authored-By: Claude <noreply@anthropic.com>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SyncManager respects messageLimit and memberLimit when restoring channel queries
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 Run ID: 📒 Files selected for processing (2)
WalkthroughThis change replaces hardcoded message and member limit constants in QueryChannelsLogic with dynamically-derived values from the current request state. Comprehensive test coverage validates both null and populated state scenarios. Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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
When
SyncManagercallsqueryFirstPage()to restore active channel queries after reconnect, it was hardcodingmessageLimit = 1andmemberLimit = 30instead of using the values originally provided by the caller. This caused the restored channel list to return fewer messages and members than expected.Note: Aligns the behaviour with iOS
Implementation
queryFirstPage()now readsmessageLimitandmemberLimitfrom the previously storedcurrentRequestin state (set when the user's originalqueryChannels()call came through). If no prior request exists (first ever call), both values fall back tonull, which lets the server apply its defaults.Two unit tests were added to
QueryChannelsLogicTestcovering:nulllimits forwarded to the APIUI Changes
No UI changes.
Testing
Run the new unit tests in
QueryChannelsLogicTest.Summary by CodeRabbit
Improvements
Tests