-
Couldn't load subscription status.
- Fork 1.3k
CMM-883 support Odie bot conversation pagination #22316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/CMM-884-support-Iterate-over-the-whole-flow-and-style
Are you sure you want to change the base?
CMM-883 support Odie bot conversation pagination #22316
Conversation
|
Claude finished @adalpari's task —— View job Code Review Complete ✅I've reviewed the pagination implementation for the AI Bot conversation feature. Here's my comprehensive feedback: Critical Issues🔴 1. Debug TODO Left in Production CodeLocation: The page size is set to 4 for testing purposes, but this must be changed before merging. A page size of 4 will cause excessive API calls in production. Action Required: Change Design & Architecture Issues🟡 2. Race Condition in Message LoadingLocation: The guard clause checking Recommendation: Use a 🟡 3. Page State ManagementLocation: The Recommendation: Consider storing pagination state per conversation ID using a map. Code Quality Issues🟡 4. Message Deduplication MissingLocation: When prepending older messages, there's no deduplication logic. If the API returns overlapping messages or pagination boundaries shift, duplicates could appear. Recommendation: Add 🟡 5. Hardcoded Threshold ValueLocation: The pagination trigger threshold is hardcoded as 4, matching the debug page size. Recommendation: Extract to a named constant for better maintainability. 🟢 6. Message ID GenerationLocation: Using Recommendation: Use Performance Considerations🟢 7. No Caching StrategyLocation: Each conversation load makes a fresh API call with no caching of previously loaded pages. Suggestion: Consider implementing local caching to reduce network calls and improve offline support. Testing & Edge Cases🟡 8. Empty Response HandlingLocation: The code assumes empty messages mean "no more pages," but this could also indicate an API error. Recommendation: Add validation to distinguish between legitimate end-of-data and error conditions. 🟡 9. Missing Test CoverageNo test files were added or modified in this PR. Recommendation: Add unit tests for pagination state management, edge cases, and concurrent loading scenarios. Positive Observations 👍
Summary & Action ItemsThe pagination implementation is generally solid with good architectural patterns. However, there are critical issues that must be addressed before merging: Must Fix Before Merge:
Strongly Recommended: Nice to Have: Overall, the code demonstrates good understanding of Compose, coroutines, and MVVM patterns. With the critical fixes applied, this will be a solid implementation of pagination. Great job on the UX considerations! 🎉 |
| params = GetBotConversationParams() | ||
| params = GetBotConversationParams( | ||
| pageNumber = pageNumber.toULong(), | ||
| // TODO: this is set to 4 for testing purpose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO is preventing the PR from passing. itemsPerPage will be changed to a higher number
...Press/src/main/java/org/wordpress/android/support/aibot/repository/AIBotSupportRepository.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/aibot/ui/AIBotSupportViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/aibot/ui/AIBotSupportViewModel.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/support/aibot/ui/AIBotConversationDetailScreen.kt
Outdated
Show resolved
Hide resolved
This is on purpose and explained here: #22316 (comment) |
Mutex and constant
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22316-d8affd9 | |
| Commit | d8affd9 | |
| Direct Download | wordpress-prototype-build-pr22316-d8affd9.apk |
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22316-d8affd9 | |
| Commit | d8affd9 | |
| Direct Download | jetpack-prototype-build-pr22316-d8affd9.apk |
Mutex and constant
… of https://github.com/wordpress-mobile/WordPress-Android into feat/CMM-883-support-Oddie-bot-conversation-pagination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Tested well for me.
I did experience one moment where the chat detail via seemingly crashed and disappeared, revealing the Help & Support view. I was unable to reproduce it. I believe I was quickly scrolling upwards in a long, paginated conversation while testing the pagination loading of older messages.
Thank you, I'll keep an eye! |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/CMM-884-support-Iterate-over-the-whole-flow-and-style #22316 +/- ##
==============================================================================================
- Coverage 39.38% 39.36% -0.02%
==============================================================================================
Files 2195 2195
Lines 105232 105296 +64
Branches 14963 14978 +15
==============================================================================================
+ Hits 41446 41454 +8
- Misses 60297 60351 +54
- Partials 3489 3491 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|





Description
This PR is adding pagination support to the bot conversations.
Testing instructions
Note: the page size is set to 4, but this is set on purpose to be able to properly test it. There's a TODO preventing the PR from passing, to remember changing it to a higher number before merge.
Screen_recording_20251027_135041.mp4