Skip to content

Migrate partial message update and reminder request bodies to generated models - #6608

Merged
gpunto merged 3 commits into
developfrom
migrate/request-bodies-2
Aug 4, 2026
Merged

Migrate partial message update and reminder request bodies to generated models#6608
gpunto merged 3 commits into
developfrom
migrate/request-bodies-2

Conversation

@gpunto

@gpunto gpunto commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Goal

Migrate the partial-message-update and reminder request bodies (partialUpdateMessage, createReminder, updateReminder) to the generated UpdateMessagePartialRequest, CreateReminderRequest, and UpdateReminderRequest network models.

Part of AND-1291

Stacked on #6607 (migrate/poll-write-requests) — this PR's base is that branch, so the diff shown is only the message/reminder changes. Merge #6607 first; GitHub will then retarget this PR to develop.

Implementation

  • Add generated UpdateMessagePartialRequest, CreateReminderRequest, UpdateReminderRequest; remove the hand-written PartialUpdateMessageRequest and ReminderRequest.
  • MoshiChatApi mappers and the message/reminder @Body types retyped to the generated models.

Testing

  • New MessageAndReminderRequestAdapterTest locks the wire shape, including the remind_at date format and the set/skip_enrich_url/skip_push fields.
  • spotlessApply, apiDump (no public-API change), detekt, and the full client testDebugUnitTest suite pass.

Summary by CodeRabbit

  • Bug Fixes

    • Improved partial message updates with more reliable handling of field changes and optional settings.
    • Improved reminder creation and updates, including correct reminder date handling and default values.
    • Ensured request data is serialized consistently for message and reminder operations.
  • Tests

    • Added coverage for populated and default request values.
    • Expanded validation of message update and reminder request serialization.

@gpunto gpunto added the pr:internal Internal changes / housekeeping label Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.95 MB 5.95 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.23 MB 11.24 MB 0.00 MB 🟢
stream-chat-android-compose 12.72 MB 12.72 MB 0.00 MB 🟢

@gpunto
gpunto force-pushed the migrate/poll-write-requests branch from 8a3d46f to f5fb3b4 Compare August 3, 2026 08:44
@gpunto
gpunto force-pushed the migrate/request-bodies-2 branch from 35020ff to 83d2b45 Compare August 3, 2026 08:49
@gpunto
gpunto marked this pull request as ready for review August 3, 2026 09:13
@gpunto
gpunto requested a review from a team as a code owner August 3, 2026 09:13
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change replaces legacy partial-message and reminder request DTOs with network-layer Moshi models. API endpoints, MoshiChatApi, API tests, and serialization tests now use the new request types and camelCase properties with explicit JSON mappings.

Changes

Request DTO migration

Layer / File(s) Summary
Network request model definitions
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/*
Added UpdateMessagePartialRequest, CreateReminderRequest, and UpdateReminderRequest. The models define nullable defaults and explicit mappings for skip_enrich_url, skip_push, remind_at, unset, and set.
API request wiring
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/MoshiChatApi.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/*
Updated partial message and reminder methods to use the new request models. Removed references to obsolete request types.
Serialization and API validation
stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTest.kt, stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/*
Updated API expectations and added serialization tests for populated and default request values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: pr:test

Suggested reviewers: velikovpetar

Poem

A rabbit hops through DTO fields,
With Moshi mapping JSON yields.
Messages set, reminders start,
New request models do their part.
The tests confirm each carrot bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the migration of partial message update and reminder request bodies to generated models.
Description check ✅ Passed The description covers the goal, implementation, stacked-PR context, and testing, with only non-critical template sections omitted.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch migrate/request-bodies-2

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/CreateReminderRequest.kt (1)

17-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Document the generated suppressions for the generated request models.

UnusedImport and RemoveRedundantQualifierName are suppressed but not documented. Add generator/model documentation for why these suppressions are required, or update the template to avoid importing unused types/quoting qualifiers.

🤖 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/CreateReminderRequest.kt`
around lines 17 - 22, Document the generated suppressions for
CreateReminderRequest.kt lines 17-22, UpdateMessagePartialRequest.kt lines
17-22, and UpdateReminderRequest.kt lines 17-22 by adding generator/model
documentation explaining the required UnusedImport and
RemoveRedundantQualifierName suppressions, or update the shared generation
template to eliminate the unused imports and redundant qualifiers across all
three request models.

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/CreateReminderRequest.kt`:
- Around line 17-22: Document the generated suppressions for
CreateReminderRequest.kt lines 17-22, UpdateMessagePartialRequest.kt lines
17-22, and UpdateReminderRequest.kt lines 17-22 by adding generator/model
documentation explaining the required UnusedImport and
RemoveRedundantQualifierName suppressions, or update the shared generation
template to eliminate the unused imports and redundant qualifiers across all
three request models.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eef70b9a-5c04-45ea-980b-b594218a7087

📥 Commits

Reviewing files that changed from the base of the PR and between f5fb3b4 and 83d2b45.

📒 Files selected for processing (10)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/MoshiChatApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/MessageApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/RemindersApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/PartialUpdateMessageRequest.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/CreateReminderRequest.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/UpdateMessagePartialRequest.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/UpdateReminderRequest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/MessageAndReminderRequestAdapterTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/testdata/MessageAndReminderRequestTestData.kt
💤 Files with no reviewable changes (1)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/PartialUpdateMessageRequest.kt

@gpunto
gpunto marked this pull request as draft August 3, 2026 09:54
Base automatically changed from migrate/poll-write-requests to develop August 3, 2026 12:13
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@gpunto
gpunto added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@gpunto
gpunto added this pull request to the merge queue Aug 4, 2026
Merged via the queue into develop with commit 8a08eb4 Aug 4, 2026
19 checks passed
@gpunto
gpunto deleted the migrate/request-bodies-2 branch August 4, 2026 07:56
@stream-public-bot stream-public-bot added the released Included in a release label Aug 13, 2026
@stream-public-bot

Copy link
Copy Markdown
Contributor

🚀 Available in v7.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:internal Internal changes / housekeeping released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants