Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AND-216] Fix error message text being overridden by moderation message. #5551

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

VelikovPetar
Copy link
Contributor

🎯 Goal

Fixes a problem in the Compose SDK where we override each error message text with the default "Moderation failed" text.

🛠 Implementation details

  • Update the DefaultMessageModeratedContent (which is also used for showing Messages with type = error, not only moderated messages) so that it prioritises showing text, and falling back to R.string.stream_compose_message_moderated if text is blank.

Note: It is now aligned with the XML implementation: ErrorMessageViewHolder

🎨 UI Changes

Before After
before.mp4
after.mp4

🧪 Testing

  1. Open compose sample app
  2. Open any chat
  3. Attempt to perform an undefined command, ex: /test
  4. The displayed error message should be: Sorry, command test doesn't exist..., not Message was blocked by moderation policies

Copy link
Contributor

github-actions bot commented Jan 9, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.04 MB 3.04 MB 0.00 MB 🟢
stream-chat-android-offline 3.25 MB 3.25 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.91 MB 7.91 MB 0.00 MB 🟢
stream-chat-android-compose 9.04 MB 9.04 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar marked this pull request as ready for review January 9, 2025 15:57
@VelikovPetar VelikovPetar requested a review from a team as a code owner January 9, 2025 15:57
Copy link
Collaborator

@testableapple testableapple left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@JcMinarro JcMinarro enabled auto-merge (squash) January 13, 2025 13:38
@JcMinarro JcMinarro disabled auto-merge January 13, 2025 13:39
@JcMinarro JcMinarro force-pushed the bug/fix-error-message-text-overridden-compose branch from 5149737 to dac347a Compare January 13, 2025 13:39
@JcMinarro JcMinarro enabled auto-merge (squash) January 13, 2025 13:39
@JcMinarro JcMinarro merged commit 0891620 into develop Jan 13, 2025
12 checks passed
@JcMinarro JcMinarro deleted the bug/fix-error-message-text-overridden-compose branch January 13, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants