Deprecate the unflag APIs since the backend endpoint is no longer supported - #6661
Deprecate the unflag APIs since the backend endpoint is no longer supported#6661andremion wants to merge 1 commit into
Conversation
…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.
|
@CodeRabbit review |
✅ Action performedReview finished.
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe 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. ChangesUnflag API deprecation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to 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: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation 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 💡
📝 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 |
SDK Size Comparison 📏
|
|

Goal
The backend endpoint
POST /moderation/unflagis 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.unflagUserandChatClient.unflagMessageMessageListController.unflagUserandMessageListController.ErrorEvent.UnflagUserErrorMessageListViewModel.unflagUserMessageListViewModel.Event.UnflagUserAdded
@Suppress("DEPRECATION")where the SDK itself still routes through them, so the build stays free of new warnings:MessageListController.unflagUser, ComposeMessageListViewModel.unflagUser, XMLMessageListViewModel.onEvent, theerrorEventHandlerinMessageListView, andChatClientModerationApiTests.ChatApi,MoshiChatApiandModerationApiare internal, so they are left as they are. They get removed together with the public APIs.No behaviour changes. The
.apidumps are unchanged, since the validator does not record annotations.Testing
./gradlew spotlessApply apiDump(no.apichanges)./gradlew detekt./gradlew :stream-chat-android-client:testDebugUnitTest --tests '*ChatClientModerationApiTests*' --tests '*MoshiChatApiTest*'Summary by CodeRabbit
Bug Fixes
Deprecations