Our Rocket chat sidebar show almost every user as offline, even though their status is different (e.g. online or away). In the admin panel under “Users”, their correct status is displayed, but still the sidebar shows them as offine.
Thanks you very much in advance for you help!
I20200921-15:14:32.677(0) Exception in defer callback: TypeError: Cannot read property ‘filter’ of undefined at RocketChatIntegrationHandler.getTriggersToExecute (app/integrations/server/lib/triggerHandler.js:505:16) at RocketChatIntegrationHandler.executeTriggers (app/integrations/server/lib/triggerHandler.js:576:34) at _wrapperFunction (app/integrations/server/triggers.js:6:38) at app/callbacks/lib/callbacks.js:147:65 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at packages/meteor.js:550:25 at runWithEnvironment (packages/meteor.js:1286:24)
RC seems to not fetch the status of a user as long as the user is not in view. But it should fetch the status as soon as it becomes visible (usually takes 1-2 seconds).
did you upgrade from a very old version directly to 3.7.0?
Because, in our case this seemed to be the problem, as we were bypassing some required database migrations by just restoring the old database into the new rocket chat.
Meanwhile, we found a solution that worked for us. As mentioned in one of the links in my first post, our rooms where missing the uids field, so I wrote a script to fix this.
If your problem comes from the same root cause, the following script may help (use at your own risk!):
db = new Mongo().getDB("rocketchat");
result = db.rocketchat_room.find({"t" : "d"}).forEach(room => {
username1 = room.usernames[0];
username2 = room.usernames[1];
if(!username1 || !username2) return;
print(`fixing room of ` + username1 + ` and ` + username2);
user1 = db.users.findOne({"username" : username1});
uid1 = user1._id;
//print(uid1);
user2 = db.users.findOne({"username" : username2});
uid2 = user2._id;
//print(uid2);
print(`Currently set uids: ` + room.uids);
room.uids = [uid1, uid2];
print(`Newly set uids: ` + room.uids);
db.rocketchat_room.save(room);
});
Damm even I am having a similar kind of issue, I have searched all over the internet and even have posted on number of threads on different forum, no solution seems to work. I am really frustrated, can anyone of you here help me resolve this issue, I am very much tired now.