Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

User's default avatar is not reflected correctly

Open noobbbbb opened this issue 1 year ago • 10 comments

Description:

Set default avatar, but only the color is reflected.

Steps to reproduce:

  1. Open profile settings page UserMenu -> Account -> Profile
  2. Set default avatar (Profile Photo is changed.)
  3. Save changes (save success dialog appears)

Expected behavior:

Avatar should change to the default avatar (username first letter and color combination)

Actual behavior:

Avatar does not display the username initial (only the color is reflected)

Server Setup Information:

  • Version of Rocket.Chat Server: 6.13.0
  • License Type: Community
  • Number of Users: 34
  • Operating System: Rocky Linux 9
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: v14.21.3
  • MongoDB Version: 6.0.7

Client Setup Information

  • Desktop App or Browser Version: 4.1.1
  • Operating System: Windows11

Additional context

  • We are using LDAP integration.
  • The storage type for file uploads is 'FileSystem'.

Relevant logs:

noobbbbb avatar Oct 16 '24 06:10 noobbbbb

I could not replicate on RC 6.13.0. But F5 / refresh was required to load the changes immediately after.

Gummikavalier avatar Oct 16 '24 06:10 Gummikavalier

@noobbbbb i can work on it

Auditbyte25 avatar Oct 16 '24 16:10 Auditbyte25

@noobbbbb , can I work on it?

adarsh-jha-dev avatar Oct 17 '24 09:10 adarsh-jha-dev

I apologize if I am wrong. Why are you asking me? Work on anything you like. All I want is for the problem to be solved.

noobbbbb avatar Oct 18 '24 00:10 noobbbbb

I tried creating a local (Windows11+WSL(Ubuntu)) environment with v6.13.0, but could not reproduce the problem. The difference from the production environment is that the file upload destination is a file system and we are using LDAP integration. Does this have anything to do with the default avatar not being reflected?

noobbbbb avatar Oct 21 '24 01:10 noobbbbb

we are using LDAP integration.

but could not reproduce the problem.

You'd need to test with LDAP authent then, and be able to repeat it.

You should also mention facts like LDAP in your bug report.

Where are the avatars stored?

reetp avatar Oct 22 '24 13:10 reetp

we are using LDAP integration.

but could not reproduce the problem.

You'd need to test with LDAP authent then, and be able to repeat it.

You should also mention facts like LDAP in your bug report.

I followed your advice and listed it under “Additional context”.

We are using LDAP integration.
The storage type for file uploads is 'FileSystem'.

Where are the avatars stored?

The avatar image files are stored in the path set to “FileSystem”. However, if you run “ResetAvatar”, no avatar image file is created or saved. We have confirmed that if an svg format image is set as the avatar, it is internally saved as a png file. Could this be related to the fact that I cannot set an svg format image for default avatar?

[Bug] svg avatar is not displayed #9859

noobbbbb avatar Oct 23 '24 02:10 noobbbbb

I found the cause. I set “UI_Use_Name_Avatar” to false in the settings and now I can use the default avatar.

I am using Japanese (multibyte) for “name” in my environment, but the process to get the first character only supports alphanumeric characters, so it seems that “the first character of the user name is not displayed in the default avatar” was occurring. 代替テキスト https://github.com/RocketChat/Rocket.Chat/blob/f79f3cc10d149b1f9def730de866a84a1df8c2e4/apps/meteor/server/routes/avatar/utils.ts# L119

Therefore, I changed “UI_Use_Name_Avatar” to false so that it is generated from “username” (account name) instead of “name” (user's full name), and now the default avatar displays the first character of the user account name.

I understand that this is a specification, but I am a little unconvinced. Is it clearly stated in the documentation that the default avatar does not support non-alphanumeric multibyte characters?

noobbbbb avatar Oct 29 '24 04:10 noobbbbb

will ask team for a review

casalsgh avatar Nov 11 '24 13:11 casalsgh

Sorry, already reviewed by the team and with changes requested

casalsgh avatar Nov 11 '24 13:11 casalsgh