RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
120 stars 237 forks source link

Bug: Pinning a message does not shows it as a pinned message. #647

Open Barrylimarti opened 5 days ago

Barrylimarti commented 5 days ago

Description:

As a user with pinning permissions, if I pinned a message in the chat, the message does not show the pinned icon immediately and also, it doesn't appear in the pinned message sidebar. However, the opposite behavior of unpinning the message is working immediately. Also, to note that these feature do work for starring the messages.

Steps to reproduce:

  1. Type a message or use any previous message.
  2. Open the pinned messages sidebar from top right corner menu.
  3. Try pinning the message.
  4. Message gets pinned but : -is not shown in the menu -pin icon is still outline -pinned icon is not visible beside the message

Expected behavior:

-should be shown in the sidebar menu -pin icon should be solid indicating pinned -pinned icon should be visible beside the message

Actual behavior:

https://github.com/user-attachments/assets/314c9d64-d81f-4770-811e-57ce8f1bb538

Barrylimarti commented 5 days ago

From my investigation, After clicking pin button, the api does get called to pin the message and the response also, comes as success. But the messages from useMessageStore doesn't update the original message with the updated pinned flag. Uploading a console log of messages when pin is clicked for a message. It can be seen that the original object does not change with the pinned key.

Screenshot 2024-10-31 at 12 42 59 AM

But this somehow happens perfectly for starring the message. Can anyone help me solving this issue?

smritidoneria commented 2 days ago

hey @Barrylimarti , The same issue has been mentioned in #653. The pr has been raised to solve the same. You can check the pr #654.

Barrylimarti commented 2 days ago

hey @Barrylimarti , The same issue has been mentioned in #653. The pr has been raised to solve the same. You can check the pr #654.

Sure, although there was no need to create a new issue if this was already present. I will check the PR once.