RocketChat / RocketChat/Rocket.Chat
[Bug][LDAP][Enterprise] Avatars not updated
@pierre-lehnen-rc is already working on this.
Since Mar 31, 2022.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
@pierre-lehnen-rc to consider
Avatar sync background job don't sync avatars.
I enabled Avatar Background Sync in Admin UI - LDAP - Enterprise - Background Sync and enabled debug level of logs.
I don't see avatar sync event in logs at all, I see only update of custom fields on LDAP_AvatarSync cron job
Steps to reproduce:
- Update all users with LDAP and get
Usernameinstead onusernameto every Rocket Chat users username - All avatars are broken in that moment
LDAP_AvatarSynccron job don't fix avatars. I guess it just don't sync avatars, it sync custom fields instead.
Expected behavior:
All avatars updated on LDAP_AvatarSync cron job
Or a better way - update only changed avatars (should be compare to current avatar in RC and in LDAP)
Actual behavior:
Users without avatars after full LDAP sync and after LDAP_AvatarSync cron job

Server Setup Information:
- Version of Rocket.Chat Server: 4.3.3
- Operating System: OL8.5
- Deployment Method: docker
- Number of Running Instances: 20
- DB Replicaset Oplog: Enabled
- NodeJS Version: 12.22.8
- MongoDB Version: 4.4.12
Client Setup Information
- Desktop App or Browser Version: 3.7.7 and Chrome 98
- Operating System: Windows 10
Additional context
Previously we updated majority of our users with REST API and that users have avatarOrigin: rest in mongodb.
That weekend we made a full sync with LDAP, and if was a nightmare!
In 4.x version for some reason Rocket Chat team decided to use same username as in LDAP, but not lowercase of that username like it was before on pre version 4.x versions. @sampaiodiego is there a serious reason for such change?
So, on full LDAP sync every username become a Username and all messages of that user are updated with that change!
MongoDB was on a very high load, and Rocket.Chat instances crashed because of out of memory.
But anyway spending all weekend in that process we updated all usernames of our users to Username (first symbol is capitalized).
But with that all avatars of updated users was gone! And avatar sync didn't fix that issue.
Relevant logs:
No
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.
Assessment
This issue has not been assessed yet.