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

[BUG] Ignoring/Unignoring user doesn't hide/unhide messages until refresh #27182

Closed
nmagedman opened this issue Nov 3, 2022 · 4 comments · Fixed by #27279
Closed

[BUG] Ignoring/Unignoring user doesn't hide/unhide messages until refresh #27182

nmagedman opened this issue Nov 3, 2022 · 4 comments · Fixed by #27279

Comments

@nmagedman
Copy link
Contributor

Description:

This is another nextgen Message Template vs. Legacy Message Template issue. Things work nicely with the Legacy implementation, but are broken under the new implementation.

Under the Legacy Message Template, if you enter a room and see a message you don't like, if you then ignore the user who posted it, it immediately collapses the message (in fact, all messages by that user in this room), replacing it with the text "This message was ignored". If you un-ignore that user, his collapsed message(s) all immediately expand to show the full message text.

Under the new Message Template, ignoring a user has no immediate effect. You must leave the room and return (or refresh the page) for the message to be re-rendered into its "This message was ignored" collapsed state. Ditto for unignoring a user -- the messages remain collapsed until the room is entered again.

Steps to reproduce:

  1. Ensure that you are using the new-style Message Template. Go to [Avatar] > My Account > Preferences > Global > Use legacy message template. Confirm it is disabled. Likewise for the equivalent system-wide setting: [Avatar] > Administration > Settings > Accounts > Default User Preferences > Use legacy message template
  2. Enter a room that has messages, preferably multiple messages by the same user
  3. Click on the username in the header of a message; click 3-dots ; click Ignore
  4. Observe the (non-)effect on the user's messages.
  5. Click on a different room. Click on the room you were just in.
  6. Observe that the user's message are now "ignored"
  7. Repeat the process but this time "unignore" the user
  8. Enable the legacy message template (see step 1)
  9. Repeat steps 2-7

Expected behavior:

All messages by that user are immediately replaced by "This message was ignored" when you ignore him.
All "This message was ignored" notices for comments by that user are immediately replaced with the actual message when you unignore him.

Actual behavior:

For steps 2-7, nothing happens.
For step 8-9, as expected.

Server Setup Information:

  • Version of Rocket.Chat Server: 5.1.2
  • Operating System: Linux
  • Deployment Method: tar
  • Number of Running Instances: 5
  • DB Replicaset Oplog: enabled
  • NodeJS Version: v14.19.3
  • MongoDB Version: 4.2.15 / wiredTiger (oplog Enabled)

Client Setup Information

  • Desktop App or Browser Version: Chrome Version 106.0.5249.119 (Official Build) (arm64)
  • Operating System: MacOS 12.6
@nmagedman
Copy link
Contributor Author

I can see that the problem relates to the lack of detection of a change to the ISubscription.ignored property so it's not triggering a re-render. But I'm not sure where exactly to make the change.

Relevant files:

  • apps/meteor/client/views/room/MessageList/components/Message.tsx
  • packages/core-typings/src/ISubscription.ts
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useIgnoreUserAction.ts
  • apps/meteor/app/ui-message/client/message.js

@hugocostadev
Copy link
Contributor

Hi, @nmagedman thank you for reporting this issue, we will address this internally and provide an improvement.

@nmagedman
Copy link
Contributor Author

@hugocostadev Just checking in: Were you able to reproduce the bug?

@yash-rajpal
Copy link
Member

Yes, we are able to reproduce the bug and we are working on it. Thanks for your help.

@kodiakhq kodiakhq bot closed this as completed in #27279 Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants