Closed johnyb0y closed 6 years ago
I'm afraid it is not fixed for new users. I have to take a new look into this.
Will this issue be fixed in 0.70? Or should it's state be changed to open again?
this was proper fixed by https://github.com/RocketChat/Rocket.Chat/pull/12154 and will be released to stable today.
Problem returned in 3.18.0. It only happens when receiving the first message from someone new. If I search for a contact and send him a message, the problem doesn't occur.
Confirm this issue.
3.18.1
Confirmed at least until 3.18.2
Confirmed at 4.1.0
Confirmed for 3.18.3
Try this fix in mongo shell:
use parties
db.rocketchat_subscription.find().forEach(function (subscription) {
var user = db.users.findOne({username: subscription.name,}, { name: 1 });
if (!user) {
return;
}
db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},});
});
@homberger any further steps needed? i executed the command but the user is still shown with username instead of real name
cd /snap/rocketchat-server/current/bin/ root@bl-rocket:/snap/rocketchat-server/current/bin# ./mongo MongoDB shell version v3.6.14 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb Implicit session: session { "id" : UUID("4ba0cd18-8f81-4f35-8ac2-XXXXXXXX") } MongoDB server version: 3.6.14 Server has startup warnings: 2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten] 2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten] WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten] See http://dochub.mongodb.org/core/prodnotes-filesystem 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] WARNING: Access control is not enabled for the database. 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] Read and write access to data and configuration is unrestricted. 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] WARNING: You are running this process as the root user, which is not recommended. 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] rs0:PRIMARY> db.rocketchat_subscription.find().forEach(function (subscription) { ... var user = db.users.findOne({username: subscription.name,}, { name: 1 }); ... if (!user) { ... return; ... } ... db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},}); ... });
The result of the command you entered is missing in your copied text. Did you only paste it into the mongo shell without executing the command, maybe?
If it was executed successfully, you should try to force reload your RC client (CTRL + SHIFT + R).
@homberger sorry for the late response. here is what i entered. I did not get any result. Just a new emtpy line and reload the client with ctrl + shift + r did not fix the issue
Enable MongoDB's free cloud-based monitoring service, which will then receive and display metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you and anyone you share the URL with. MongoDB may use this information to make product improvements and to suggest MongoDB products and deployment options to you.
rs0:PRIMARY> db.rocketchat_subscription.find().forEach(function (subscription) { ... var user = db.users.findOne({username: subscription.name,}, { name: 1 }); ... if (!user) { ... return; ... } ... db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},}); ... }); rs0:PRIMARY> `
my issue was i was not selecting the correct database (thank you to rocket chat support team)
rs0:PRIMARY> show dbs admin 0.000GB config 0.000GB local 2.381GB parties 1.536GB rs0:PRIMARY> use parties
After that i executed this and it was fixed directly
`var subscriptions = db.rocketchat_subscription.find({ t: 'd', });
subscriptions.forEach(function(subscription) { var user = db.users.findOne({ username: subscription.name, }, { name: 1 }); if (!user) { return; } db.rocketchat_subscription.update({ _id: subscription._id, }, { $set: { fname: user.name, }, }); })`
@homberger any further steps needed? i executed the command but the user is still shown with username instead of real name
In my comment a line was missing: use parties
Sorry!
use parties db.rocketchat_subscription.find().forEach(function (subscription) { var user = db.users.findOne({username: subscription.name,}, { name: 1 }); if (!user) { return; } db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},}); });
Hi! Works fine!
But this is a very long and expensive query:(
However many thanks for temporary solution. :)
I'm facing the same problem where I need to run the mongo query in order to show the full name from the users in the sidebar. My server information: Deployment Version: 3.18.7 Apps Engine Version: 1.27.1 Node Version: v12.22.1 Database Migration: 232 (3 de Agosto de 2022 06:31) MongoDB: 4.0.28 / mmapv1 (oplog Enabled)
Right now I'm creating a script to run the query daily in order to fix the display name. Does somebody found a solution to fix? Thanks!
@paulopera die Script i postet on 17.03.22 fixed the wrong names for me, with the latest rocket chat version i did not notice the issue again, so i just had to fix the usernames onces with the script
The scrip only works for the past conversations, some new conversations are still displaying the username and not the display name. Could you please share the server information you're running right now @icerootsvw ? I suspect because I'm running the 3.18.* I'm missing some DB update or something like that.
@paulopera with 4.x/stable: 4.8.3 2022-08-08 the bug is gone, so maybe you check Version 4 if that is fine for you. I dont know if the bugfix was backported to 3.x as well
I'm still running the old version because of the changes in Basic User Data Sync.
Hello,
Got same issue, the RC client shows only usernames, even on the 'user info' there is no field that displays user's full name. Admin settings / Client Settings doesn't seem to change the behavior.
Well running the laltest stable version of RC: 6.11.1 / Mongo: 5.0
thanks in advance :)
Hello @CeeSharpDev I got it fixed by using the script @icerootsvw posted but now we need to use the mongosh instead of the mongo to run the script. Here the steps I did as I run RC on docker:
1- At the container folder: docker compose exec mongo bash 2- At the mongo container bash: mongosh 3- Select the mongo RC DB: use rocketchat; 4- Run the script provided above by @icerootsvw here
And now all the users got the Display Names instead of the usernames. If some user still shows only the username try to logout and login back again that it will fix.
Hello @paulopera thanks a ton for your response. Actually a wrong setting via Admin Settings was toggled earlier, hence no changes were realized, But found the right setting: 'Layout --> Use Real Names', this had fixed the issue.
Thank you again :)
You are welcome @CeeSharpDev ! Indeed there's this setting where you can choose the Real Name.
Description:
After updating to 0.68.0 the left sidebar displays usernames instead of Real names. I already searched settings (twice) and as far as I can tell every setting is set to Use Real Names. Have i overlooked something ?
EDIT: Just to be clear: Before the update the sidebar showed the Real Names, not the usernames.
Steps to reproduce:
Expected behavior:
Setting shouldn't change. Also toggling the various "Use Real Names" settings should have an effect and configure the sidebar to use Real Names again.
Actual behavior:
Username is shown and settings don't seem to change anything regarding the sidebar.
Server Setup Information:
Thanks.