Migrate queryThreads, queryReminders, queryDrafts, and partial-update-thread request bodies to generated models - #6600
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
9f53138 to
55e2e6d
Compare
8884b63 to
77a5e3a
Compare
WalkthroughThe change moves draft, reminder, thread query, and thread partial-update requests to shared network models. API wiring now uses the new models and ChangesNetwork request model migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryDraftsRequest.kt (1)
17-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument or remove the file-level suppressions.
The shared model template suppresses
UnusedImportandRemoveRedundantQualifierNamewhile each file contains unusedListandMapimports and fully qualified collection types. Remove the unused imports and redundant qualifiers. If code generation requires these suppressions, document that requirement and retain only the required suppression keys.
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryDraftsRequest.kt#L17-L22: Remove or document the suppressions.stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryRemindersRequest.kt#L17-L22: Remove or document the suppressions.stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryThreadsRequest.kt#L17-L22: Remove or document the suppressions.stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/UpdateThreadPartialRequest.kt#L17-L22: Remove or document the suppressions.As per coding guidelines, “avoid suppressions unless documented.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryDraftsRequest.kt` around lines 17 - 22, Remove the unnecessary file-level suppressions and clean up unused List/Map imports and fully qualified collection types in QueryDraftsRequest.kt (lines 17-22), QueryRemindersRequest.kt (lines 17-22), QueryThreadsRequest.kt (lines 17-22), and UpdateThreadPartialRequest.kt (lines 17-22). If the model generator requires any suppression, document that requirement and retain only the specifically required keys.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryDraftsRequest.kt`:
- Around line 17-22: Remove the unnecessary file-level suppressions and clean up
unused List/Map imports and fully qualified collection types in
QueryDraftsRequest.kt (lines 17-22), QueryRemindersRequest.kt (lines 17-22),
QueryThreadsRequest.kt (lines 17-22), and UpdateThreadPartialRequest.kt (lines
17-22). If the model generator requires any suppression, document that
requirement and retain only the specifically required keys.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f5e8d055-0f30-4328-b80a-c36432c2e913
📒 Files selected for processing (14)
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/MoshiChatApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/MessageApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/RemindersApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ThreadsApi.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryDraftsRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryRemindersRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryThreadsRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryDraftsRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryRemindersRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryThreadsRequest.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/UpdateThreadPartialRequest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/QueryPayloadRequestAdapterTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/testdata/QueryPayloadRequestTestData.kt
💤 Files with no reviewable changes (3)
- stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryDraftsRequest.kt
- stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryThreadsRequest.kt
- stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryRemindersRequest.kt
andremion
left a comment
There was a problem hiding this comment.
LGTM. Three notes, none blocking.
|
|
🚀 Available in v7.8.0 |


Goal
Migrate the
queryThreads,queryReminders, andqueryDraftsrequest bodies (POST /threads,POST /reminders/query,POST /drafts/query) to the generatedQueryThreadsRequest/QueryRemindersRequest/QueryDraftsRequestnetwork models. Completes the query-payload request-body cluster. Part of the incremental OpenAPI model migration.Part of AND-1291
Implementation
internalrequest models innetwork.models; remove the hand-writtenapi2.model.requestsversions.MoshiChatApi/ThreadsApi/RemindersApi/MessageApi/tests use the generated types by their real names.sortfield is nowList<SortParamRequest>(wasList<Map<String, Any>>), so the call sites switch fromsort.toDto()tosort.toSortParams().filter?.toMap()fits the generatedMap<String, Any?>field.queryThreads' call site switches its named args to the generated camelCase params (memberLimit/participantLimit/replyLimit). No wire-shape change.Testing
spotlessCheck,apiCheck(no API drift),detekt, and the full clienttestDebugUnitTestsuite pass.created_at descsort:POST /threads,POST /reminders/query, andPOST /drafts/queryeach send"sort":[{"direction":-1,"field":"created_at"}]and return201.queryThreadsalso correctly serializesmember_limit/participant_limit/reply_limit/watch.Also folds in the
partialUpdateThreadrequest-body migration (PATCH /threads/{id}→ generatedUpdateThreadPartialRequest) — bundled here to keep the thread-request migrations together.Summary by CodeRabbit
Bug Fixes
Tests