Skip to content

Fix: getchannelavatarurl function in chatHeader and RoomInformation to Reflect Updated Avatar Changes.#888

Closed
AyushKumar123456789 wants to merge 1 commit intoRocketChat:developfrom
AyushKumar123456789:fix-Room_Avatar_not_updating_after_changes_in_Rocket.chat
Closed

Fix: getchannelavatarurl function in chatHeader and RoomInformation to Reflect Updated Avatar Changes.#888
AyushKumar123456789 wants to merge 1 commit intoRocketChat:developfrom
AyushKumar123456789:fix-Room_Avatar_not_updating_after_changes_in_Rocket.chat

Conversation

@AyushKumar123456789
Copy link
Contributor

Brief Title

Fix getChannelAvatarURL to Reflect Updated Avatar Changes in rocket.chat.

Acceptance Criteria fulfillment

  • Ensure updated avatars are displayed correctly after changes in Rocket.Chat.
  • Ensure getChannelAvatarURL function handles avatarETag correctly to fetch updated images.

Fixes #887

Video/Screenshots

Room.Avatar.bug.solved.mp4

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.

);
const workspaceLevelRoles = useUserStore((state) => state.roles);

const { RCInstance, ECOptions } = useRCContext();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any specific reason for removing this and using useContext here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for reviewing the changes. Both implementations were working correctly, and there wasn't a specific reason to prefer one over the other. I chose to switch to useContext because I find that more readable and easier to understand. However, if you have any concerns or suggestions, I’m eager to learn and discuss them.

<Avatar
size="36px"
style={{ marginRight: '6px' }}
url={getChannelAvatarURL(channelInfo.name)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for reviewing the changes ! , I decided to use RCInstance.rid instead of channelInfo.name for the avatar URL because it links the avatar directly to the unique room ID. This ensures that the avatar updates correctly with the avatarETag (i.e cache-busting via avatarETag) and helps avoid any issues if channel names change or get duplicated. It should keep the avatar display consistent and up-to-date whenever there are changes in Rocket.Chat.

@Spiral-Memory
Copy link
Collaborator

Looks like a great addition, @AyushKumar123456789
Thanks, Just want to make sure on few things

@Spiral-Memory Spiral-Memory added the question Further information is requested label Jan 27, 2025
@Spiral-Memory
Copy link
Collaborator

Hi @AyushKumar123456789
Can you please reply to the review comments

@AyushKumar123456789
Copy link
Contributor Author

AyushKumar123456789 commented Feb 12, 2025

Sir, I think I have replied to the two comments you made 2 weeks ago, pardon me but I am not able to understand which comments there are any more than those two questions you are talking about

@Spiral-Memory
Copy link
Collaborator

Screenshot_2025-02-12-19-23-28-78_320a9a695de7cdce83ed5281148d6f19.jpg

Screenshot_2025-02-12-19-23-14-51_320a9a695de7cdce83ed5281148d6f19.jpg

@AyushKumar123456789
Copy link
Contributor Author

AyushKumar123456789 commented Feb 12, 2025

image
image
I have replied to it; I don't know why this message did not reach you. Did I do something wrong?

@AyushKumar123456789
Copy link
Contributor Author

AyushKumar123456789 commented Feb 12, 2025

Sir, I'm looking forward to hearing back from you. Let me know if there is anything I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug : Room/Channel Avatar Not Updating After Changing it in Rocket.Chat

2 participants