RocketChat / RocketChat/Rocket.Chat
User avatar doesn't update in real-time
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
When a user updates their avatar, the change is not reflected consistently across the UI. The avatar in the chat feed remains the old version, even for new messages, indicating a severe client-side caching issue caused by a failed real-time update.
Steps to reproduce:
- Navigate to Account -> Profile.
- Upload a new user avatar and save the changes.
- Observe that the avatar changes correctly on the profile page.
- Switch to a different rocket.chat tab and then switch back to the profile tab. The avatar in the top-left corner reverts to the old one.
- Perform a full page refresh
(Ctrl+R or Cmd+R). The avatar now appears correctly in most of the UI. - Navigate to a channel or DM where you have sent messages. The avatar next to your existing messages in the chat feed is still the old one.
- Send a new message. The new message also renders with the old avatar.
Expected behavior:
After a user successfully updates their avatar, the new avatar should be displayed immediately and consistently across all parts of the application without requiring a page refresh.
Actual behavior:
The user avatar update is inconsistent. It requires a hard refresh to appear in most places, but it remains stale (stuck on the old version) indefinitely within the channel and DM
https://github.com/user-attachments/assets/12f9754a-b116-47a8-9e63-e01a0d00ddbb
Server Setup Information:
- Version of Rocket.Chat Server: 7.9.0-develop
- License Type:
- Number of Users: 1
- Operating System: Ubuntu (linux)
- Deployment Method:
- Number of Running Instances:
- DB Replicaset Oplog: Enabled
- NodeJS Version: 22.16.0
- MongoDB Version: 7.0.16
Client Setup Information
- Desktop App or Browser Version:
- Operating System:
Additional context
Proof of Caching Issue:
Inspecting the image URLs confirms this analysis. The correctly updated avatar uses a URL with a new etag parameter, while the stale avatar in the chat feed is rendered using the base URL without the etag, causing the browser to serve the old, cached version.
Stale URL (in chat feed): http://localhost:3000/avatar/khizarshah01
Correct URL (in profile): http://localhost:3000/avatar/khizarshah01?etag=Me9zRvq2qQmMhx
Suspected Cause: The server-side process successfully saves the new avatar but fails to trigger the client-facing updateAvatar real-time event, leaving the client's cache stale.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the profile avatar update and the client-facing updateAvatar real-time event, then compare how the profile, chat feed, and new messages construct avatar URLs. Done means the new avatar appears consistently across those surfaces without a refresh, including existing and newly sent messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, typescript
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100