Skip to content

Migrate the replies, pinned messages and send reaction responses to the generated responses - #6774

Merged
gpunto merged 1 commit into
developfrom
migrate/message-list-reaction-envelopes
Oct 5, 2026
Merged

gpunto merged 1 commit into
developfrom
migrate/message-list-reaction-envelopes

Conversation

@gpunto

@gpunto gpunto commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Parse the replies, pinned messages and send reaction responses with the generated response models.

Part of AND-1291

Implementation

  • The four replies endpoints return GetRepliesResponse, pinned messages returns GetPinnedMessagesResponse and send reaction returns SendReactionResponse.
  • Delete the hand-written MessagesResponse and ReactionResponse envelopes. The messages and reactions inside were already generated models, so call sites don't change.
  • All three responses now require duration, and the send reaction response also requires message. The backend always sends both.

Testing

MessageListResponseParsingTest covers each response, a missing duration and a send reaction response without its message. MoshiChatApiTest rows cover the new response types.

On a device: loaded replies through all four variants, loaded pinned messages and sent a reaction. Message order, pinned state, reaction type, score and user, and custom data round-trips all matched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of responses for pinned messages, message replies, and sent reactions.
    • Pinned-message and reply responses now support empty message lists, and response details are parsed more reliably.

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

github-actions Bot commented Oct 2, 2026

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 Oct 2, 2026

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.17 MB 6.17 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.48 MB 11.48 MB 0.00 MB 🟢
stream-chat-android-compose 13.14 MB 13.14 MB 0.00 MB 🟢

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@gpunto
gpunto marked this pull request as ready for review October 5, 2026 07:22
@gpunto
gpunto requested a review from a team as a code owner October 5, 2026 07:22
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19953695-3efd-41dc-a8ca-ae10e8221520
📥 Commits

Reviewing files that changed from the base of the PR and between 72df2a4 and 220513c.

📒 Files selected for processing (8)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ChannelApi.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/network/models/GetPinnedMessagesResponse.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/GetRepliesResponse.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/SendReactionResponse.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/api2/MoshiChatApiTestArguments.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/MessageListResponseParsingTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The pinned-message, reply, and reaction endpoints now use specialized response models. The models include endpoint-specific fields. API fixtures and parsing tests use and validate the new response types.

Changes

Endpoint-specific response models

Layer / File(s) Summary
Define response models
stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/GetPinnedMessagesResponse.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/GetRepliesResponse.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/SendReactionResponse.kt
The response models define JSON-mapped fields for pinned messages, replies, and sent reactions. Pinned-message and reply models include a required duration and a messages list that defaults to empty.
Use response models in endpoints
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ChannelApi.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/MessageApi.kt
The pinned-message, reply, and reaction endpoints return their specialized response types. HTTP annotations, paths, and query parameters are unchanged.
Update fixtures and verify parsing
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/api2/MoshiChatApiTestArguments.kt, stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/MessageListResponseParsingTest.kt
API test fixtures use the new response types. Parsing tests check message and reaction fields and expect JsonDataException when required fields are missing.

Priority: ⬇️ Low

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

Change: Refactor

Suggested reviewers: velikovpetar

Merge Risk: ⚪ Minimal · up to 22051

No merge-blocking issue is identified; the change is ready for normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 22051

Requests, authentication markers and reaction-state ownership remain unchanged. The remaining risk is response compatibility: missing newly required fields could make a committed reaction appear to fail. No introduced security vulnerability was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected change affects decoding and completion of the same channel/message operations, rather than adding request authority or broader resource selectors. Its unresolved exposure is client-visible reaction completion after a potentially committed server mutation; cross-tenant or privileged access expansion was not established by this comparison.

Trust Boundaries and Controls

  • observed — The endpoint interfaces retain AuthenticatedApi markers. Reaction sending retains its current-user and nonblank message/type preconditions, input-derived call identity, and existing plugin pipeline. Optimistic state and persistence remain listener-owned. These client-side facts do not independently verify server-side authorization.

Resilience and Maintainability Implications

  • inferred — If a producer commits a reaction but omits a newly required response field, decoding feeds the existing failure and sync-status paths instead of reporting success. The default retry policy disables retries, which limits immediate repetition but does not establish reconciliation with server commit state. Whether this condition occurs in supported deployments, or is retried under configured policies, remains unverified.
🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the migration of replies, pinned-message, and send-reaction responses to generated response models.
Description check ✅ Passed The description covers the goal, implementation, related issue, and testing. UI screenshots and visual checklists are not relevant to this API response-model change.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the message stream
New response shapes appear in view
Replies bring their duration field
Reactions carry message too
Tests parse each model through
Then hop along the data trail

Comment @coderabbitai help to get the list of available commands.

@aleksandar-apostolov aleksandar-apostolov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gpunto
gpunto added this pull request to the merge queue Oct 5, 2026
Merged via the queue into develop with commit 7da3366 Oct 5, 2026
25 of 26 checks passed
@gpunto
gpunto deleted the migrate/message-list-reaction-envelopes branch October 5, 2026 18:05
@stream-public-bot stream-public-bot added the released Included in a release label Oct 8, 2026
@stream-public-bot

Copy link
Copy Markdown
Contributor

🚀 Available in v7.14.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