Skip to content

fix: [REACT-218] adjust filterErrorMessages to only filter current user's messages #1510

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnautov-anton
Copy link
Contributor

@arnautov-anton arnautov-anton commented Apr 3, 2025

Description of the changes, What, Why and How?

Ref: GetStream/stream-chat-react#2675

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Size Change: +279 B (+0.05%)

Total Size: 533 kB

Filename Size Change
dist/browser.es.js 117 kB +62 B (+0.05%)
dist/browser.full-bundle.min.js 63.7 kB +31 B (+0.05%)
dist/browser.js 118 kB +62 B (+0.05%)
dist/index.es.js 117 kB +60 B (+0.05%)
dist/index.js 118 kB +64 B (+0.05%)

compressed-size-action

Copy link
Member

@khushal87 khushal87 left a comment

Choose a reason for hiding this comment

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

What was the purpose of this change? It looks fine anyways.

(message) =>
!(
message.type === 'error' &&
(message.user?.id === userId || message.user_id === userId)
Copy link
Contributor

Choose a reason for hiding this comment

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

@arnautov-anton can we add this as a param like onlyOwnMessages or similar? To avoid changing the method's behavior. Btw this is a bit of a weird behavior because this means that async moderated messages will be filtered for the sender, but not for receivers. But I understand the reason for this.

@arnautov-anton arnautov-anton changed the title fix: adjust filterErrorMessages to only filter current user's messages fix: [REACT-218] adjust filterErrorMessages to only filter current user's messages Apr 7, 2025
@szuperaz
Copy link
Contributor

szuperaz commented Apr 7, 2025

@arnautov-anton how does all this work for thread messages?

@arnautov-anton
Copy link
Contributor Author

What was the purpose of this change? It looks fine anyways.

My apologies, @khushal87, forgot to reference the relevant PR at first - it's connected to the BlockedMessage feature, see also this Slack message.

@arnautov-anton how does all this work for thread messages?

I'm not sure it does, @szuperaz. Either way I'm really not happy with this fix (or the existing behavior), I've drafted this up based on our conversation but while I was testing it out it feels clunky at best - I'd rather we go with Angular's behavior where the error messages are kept for the duration of the application runtime. I'll release the BlockedMessage feature without this for now.

@arnautov-anton arnautov-anton marked this pull request as draft April 7, 2025 16:58
arnautov-anton added a commit to GetStream/stream-chat-react that referenced this pull request Apr 8, 2025
### 🎯 Goal

This PR adds a `MessageBlocked` component to render instead of a normal
message UI whenever sync/async moderation blocks an inappropriate
message.

Ref: GetStream/stream-chat-js#1510
Ref: GetStream/stream-chat-css#327

Also awaits BE changes to the `message.updated` message object's
payload.
arnautov-anton added a commit to GetStream/stream-chat-react that referenced this pull request Apr 8, 2025
This PR adds a `MessageBlocked` component to render instead of a normal
message UI whenever sync/async moderation blocks an inappropriate
message.

Ref: GetStream/stream-chat-js#1510
Ref: GetStream/stream-chat-css#327

Also awaits BE changes to the `message.updated` message object's
payload.
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