RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.63k stars 10.63k forks source link

User's default avatar is not reflected correctly #33602

Open noobbbbb opened 1 month ago

noobbbbb commented 1 month ago

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:

Client Setup Information

Additional context

Relevant logs:

Gummikavalier commented 1 month ago

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

jopaleti commented 4 weeks ago

@noobbbbb i can work on it

adarsh-jha-dev commented 4 weeks ago

@noobbbbb , can I work on it?

noobbbbb commented 4 weeks ago

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 commented 3 weeks ago

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?

reetp commented 3 weeks ago

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?

noobbbbb commented 3 weeks ago

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 commented 2 weeks ago

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?

casalsgh commented 4 days ago

will ask team for a review

casalsgh commented 4 days ago

Sorry, already reviewed by the team and with changes requested