RocketChat / RocketChat/Rocket.Chat

Incomplete avatars are displayed for thread subscribers when avatar upload is not completed

Open
#41,802 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description

Rocket.Chat displays an incomplete avatar for a thread subscriber even though the avatar upload was not successfully completed.

When an avatar upload is interrupted, the avatar object is uploaded to object storage and its reference remains in the database, but the avatar is not marked as complete (complete: true). The thread subscriber list nevertheless uses this incomplete avatar reference when fetching the subscriber's avatar.

This can result in a corrupted/incomplete avatar being displayed for a user who should have no avatar. The issue is particularly visible when the affected user is one of the first two thread subscribers, since Rocket.Chat displays only the first two subscribers in the thread UI.

Steps to reproduce:
  1. Use a user who does not currently have an avatar.
  2. Start uploading an avatar for the user.
  3. Interrupt or cancel the avatar upload before it completes.
  4. Create or open a thread.
  5. Have the affected user subscribe to the thread.
  6. Open the thread subscriber list.
  7. Ensure the affected user is one of the first two subscribers displayed.
  8. Observe the avatar displayed for the affected user.
Expected behavior:

If an avatar upload is incomplete and the avatar record does not have complete: true, Rocket.Chat should not use the stored object-storage reference when displaying the user's avatar.

The user's default avatar should be displayed instead, using the first letter of their name.

Actual behavior:

The thread subscriber list uses the object-storage reference for the incomplete avatar and displays the resulting corrupted/incomplete avatar.

The database contains a reference to the avatar object, but the avatar is not marked as complete (complete: true). Despite this, the avatar is returned/used when fetching the thread subscribers.

Server Setup Information:
  • Version of Rocket.Chat Server: 8.7.0
  • License Type:
  • Number of Users:
  • Operating System:
  • Deployment Method:
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
Client Setup Information
  • Desktop App or Browser Version:
  • Operating System:
Additional context

The issue appears to be related to avatar retrieval for thread subscribers rather than the normal user profile avatar display.

The avatar object itself exists in object storage, but the corresponding database record does not indicate a successfully completed upload (complete: true). The subscriber avatar retrieval appears to rely on the stored object reference without checking whether the upload was completed.

Rocket.Chat threads display only the first two subscribers, so the issue is observable when the affected subscriber is among those first two users.

Relevant logs:

No relevant logs available.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the thread subscriber list and trace the avatar retrieval path, focusing on how the stored avatar reference is used when the record lacks complete: true. Done means interrupted uploads fall back to the user's default initial-based avatar rather than displaying the incomplete object-storage avatar.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.