Skip to content

Deprecate the unflag APIs since the backend endpoint is no longer supported - #6661

Merged
andremion merged 1 commit into
developfrom
andrerego/and-1448-deprecate-the-unflag-apis-in-the-chat-sdk
Aug 26, 2026
Merged

Deprecate the unflag APIs since the backend endpoint is no longer supported#6661
andremion merged 1 commit into
developfrom
andrerego/and-1448-deprecate-the-unflag-apis-in-the-chat-sdk

Conversation

@andremion

@andremion andremion commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Goal

The backend endpoint POST /moderation/unflag is deprecated and is a no-op. The SDK still exposes public APIs that call it, so an integrator can call something that silently does nothing.

This PR marks those APIs as deprecated. The removal happens in the next major version.

Resolves AND-1448

Implementation

Added @Deprecated (WARNING level) to the public APIs that reach the endpoint:

  • ChatClient.unflagUser and ChatClient.unflagMessage
  • MessageListController.unflagUser and MessageListController.ErrorEvent.UnflagUserError
  • Compose MessageListViewModel.unflagUser
  • XML MessageListViewModel.Event.UnflagUser

Added @Suppress("DEPRECATION") where the SDK itself still routes through them, so the build stays free of new warnings: MessageListController.unflagUser, Compose MessageListViewModel.unflagUser, XML MessageListViewModel.onEvent, the errorEventHandler in MessageListView, and ChatClientModerationApiTests.

ChatApi, MoshiChatApi and ModerationApi are internal, so they are left as they are. They get removed together with the public APIs.

No behaviour changes. The .api dumps are unchanged, since the validator does not record annotations.

Testing

  • ./gradlew spotlessApply apiDump (no .api changes)
  • ./gradlew detekt
  • ./gradlew :stream-chat-android-client:testDebugUnitTest --tests '*ChatClientModerationApiTests*' --tests '*MoshiChatApiTest*'

Summary by CodeRabbit

  • Bug Fixes

    • Clarified that unflagging users and messages is no longer supported by the backend.
    • Existing unflag actions remain available but have no effect.
  • Deprecations

    • Added deprecation warnings across moderation and message-list APIs.
    • Unflagging functionality is planned for removal in the next major release.

…oint

The backend no longer supports un-flagging, so these calls do nothing.
Mark the public APIs as deprecated and suppress the warning at the
internal call sites. They get removed in the next major version.
@andremion andremion added the pr:improvement Improvement label Aug 25, 2026
@andremion

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@andremion andremion self-assigned this Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Aug 25, 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.

@andremion andremion changed the title Deprecate the unflag APIs Deprecate the unflag APIs since the backend endpoint is no longer supported Aug 25, 2026
@andremion
andremion marked this pull request as ready for review August 25, 2026 15:49
@andremion
andremion requested a review from a team as a code owner August 25, 2026 15:49
@andremion
andremion enabled auto-merge August 25, 2026 15:49
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 491f408d-0988-4249-8916-3c37e9c75fdd

📥 Commits

Reviewing files that changed from the base of the PR and between 89b0344 and 024d367.

📒 Files selected for processing (6)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/ChatClient.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/ChatClientModerationApiTests.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/viewmodel/messages/MessageListViewModel.kt

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


Walkthrough

The change deprecates client, Compose, and UI unflag APIs and related events because backend un-flagging is unsupported. Existing implementations remain available, while internal consumers and moderation tests suppress deprecation warnings.

Changes

Unflag API deprecation

Layer / File(s) Summary
Client moderation API deprecations
stream-chat-android-client/.../ChatClient.kt, stream-chat-android-client/.../ChatClientModerationApiTests.kt
unflagUser and unflagMessage now include deprecation warnings. Moderation API tests suppress these warnings.
Compose and common UI deprecations
stream-chat-android-compose/.../MessageListViewModel.kt, stream-chat-android-ui-common/.../MessageListController.kt
Compose and common UI unflag methods and related error events now include deprecation warnings.
UI deprecation handling
stream-chat-android-ui-components/.../MessageListView.kt, stream-chat-android-ui-components/.../MessageListViewModel.kt
UI event handling suppresses warnings for deprecated unflag events and error events.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 024d3

This change marks unsupported unflag APIs for removal in a future major release without changing current behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: velikovpetar, gpunto

Poem

I’m a rabbit with a warning to share,
Unflag paths now signal, “handle with care.”
The calls still remain, though their future is brief,
Tests hush the warnings and hop past the grief,
While UI events mark the old trail bare.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files.
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 main change: deprecating public unflag APIs because the backend endpoint is unsupported.
Description check ✅ Passed The description clearly explains the goal, implementation, affected APIs, expected behavior, and testing. It omits the UI changes, contributor checklist, reviewer checklist, and GIF template sections,…
Full details: Description check

Explanation

The description clearly explains the goal, implementation, affected APIs, expected behavior, and testing. It omits the UI changes, contributor checklist, reviewer checklist, and GIF template sections, but these omissions are non-critical for this non-visual API deprecation.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch andrerego/and-1448-deprecate-the-unflag-apis-in-the-chat-sdk

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.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.07 MB 6.07 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.37 MB 11.37 MB 0.00 MB 🟢
stream-chat-android-compose 12.85 MB 12.85 MB 0.00 MB 🟢

@andremion andremion removed their assignment Aug 25, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 25, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
5 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@andremion
andremion added this pull request to the merge queue Aug 26, 2026
Merged via the queue into develop with commit b54001f Aug 26, 2026
24 of 27 checks passed
@andremion
andremion deleted the andrerego/and-1448-deprecate-the-unflag-apis-in-the-chat-sdk branch August 26, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants