Skip to content

Migrate the query banned users payload to the generated QueryBannedUsersPayload - #6737

Merged
gpunto merged 1 commit into
developfrom
migrate/query-banned-users
Sep 28, 2026
Merged

gpunto merged 1 commit into
developfrom
migrate/query-banned-users

Conversation

@gpunto

@gpunto gpunto commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Send the query banned users payload with the generated QueryBannedUsersPayload.

Part of AND-1291

Implementation

  • Use the generated QueryBannedUsersPayload, with the typed SortParamRequest sort, for the
    query_banned_users payload, and delete the hand-written QueryBannedUsersRequest.

The payload on the wire is unchanged, key order aside. The new optional exclude_expired_bans stays unset.

Testing

QueryBannedUsersPayloadAdapterTest pins the serialized payload.

On a device, with two bans two seconds apart: the filter, both sort directions, limit, offset and each
created_at bound returned exactly the expected bans, and every BannedUser field matched.

🤖 Generated with Claude Code

@gpunto gpunto added the pr:internal Internal changes / housekeeping label Sep 25, 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 Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.09 MB 6.09 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.39 MB 11.39 MB 0.00 MB 🟢
stream-chat-android-compose 13.07 MB 13.07 MB -0.00 MB 🚀

@gpunto
gpunto force-pushed the migrate/query-banned-users branch from 529fc69 to 3192a5b Compare September 28, 2026 13:41
@gpunto
gpunto marked this pull request as ready for review September 28, 2026 13:42
@gpunto
gpunto requested a review from a team as a code owner September 28, 2026 13:42
@coderabbitai

coderabbitai Bot commented Sep 28, 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: fa0b246f-ac41-467f-aa07-5017019d4755

📥 Commits

Reviewing files that changed from the base of the PR and between 59b6bea and 3192a5b.

📒 Files selected for processing (7)
  • 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/ModerationApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryBannedUsersRequest.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryBannedUsersPayload.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/QueryBannedUsersPayloadAdapterTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/testdata/QueryBannedUsersPayloadTestData.kt
💤 Files with no reviewable changes (1)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryBannedUsersRequest.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 banned-user query now uses QueryBannedUsersPayload in place of QueryBannedUsersRequest. The new model defines the query fields and JSON mappings. API wiring and tests use the new payload.

Changes

Banned-user query

Layer / File(s) Summary
Payload model and serialization coverage
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/requests/QueryBannedUsersRequest.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/QueryBannedUsersPayload.kt, stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/*
The old request model is removed. QueryBannedUsersPayload defines the query fields and JSON mappings. Serialization tests cover populated and default payloads.
Query API wiring and request test
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ModerationApi.kt, stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/MoshiChatApi.kt, stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTest.kt
ModerationApi and MoshiChatApi use QueryBannedUsersPayload. The query test checks the payload fields and sort parameter.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Suggested reviewers: velikovpetar

Merge Risk: ⚪ Minimal · up to 3192a

The banned-user query migration has no identified issue requiring a fix before merge. Normal checks remain appropriate.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3192a

The query appears to retain its authenticated endpoint and request behavior. No new security exposure was identified, but server-side enforcement was not assessed.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The examined change affects construction and serialization of the SDK's banned-user query; no new client route, credential input, or tenant override is evident in that path.

Trust Boundaries and Controls

  • observed — The client-to-service request remains on the authentication-annotated moderation endpoint. This establishes the retained client-side marker, not the effectiveness of server-side authorization.
🚥 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 5 functions across 6 files. 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 identifies the main change: migrating the query banned users payload to the generated QueryBannedUsersPayload.
Description check ✅ Passed The description includes the Goal, Implementation, and Testing sections. It explains the generated payload migration, the deleted hand-written request, unchanged wire format, and test coverage. UI, ch…
  • 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

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 payload fields,
And sorts the bans in tidy rows.
JSON meets the model in spring,
The tests confirm each value flows.
One hop, one query, all set to go.

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

@sonarqubecloud

Copy link
Copy Markdown

@gpunto
gpunto added this pull request to the merge queue Sep 28, 2026
Merged via the queue into develop with commit 7c7eddb Sep 28, 2026
21 checks passed
@gpunto
gpunto deleted the migrate/query-banned-users branch September 28, 2026 15:51
@stream-public-bot stream-public-bot added the released Included in a release label Sep 30, 2026
@stream-public-bot

Copy link
Copy Markdown
Contributor

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