Presence indicator in the profile element stuck at away status
Description:
Presence indicator in user profile element / menu gets stuck in Away status after idling for the predefined time.
This does not concern actual status visible to other users.
This happens very often but not always. I haven't been able to pinpoint exact way to reproduce reliably.
Steps to reproduce:
- Set the status to
Onlinefrom the top left profile menu. - Do not use the browser; wait that idle timeout turns the user status from
OnlinetoAwaystatus - Focus back on the browser and write couple of messages to any channel
Expected behavior:
Away status should change back to Online.
Actual behavior:
When you focus to RC browser window, status may flash very briefly (tens of milliseconds) into green but after that remains orange at Away status.
(The user's presence status is correct when checked by other users. The issue is purely local.)
Server Setup Information:
- Version of Rocket.Chat Server: 6.13.0
- License Type: Enterprise
- Number of Users: 500+
- Operating System: RHEL8
- Deployment Method: tar
- Number of Running Instances: 4
- DB Replicaset Oplog: Yes
- NodeJS Version: 14.21.3
- MongoDB Version: 6.0
Client Setup Information
- Desktop App or Browser Version: At least the latest Firefox and RC desktop client. In both Windows and Linux.
Additional context
Happens in both old and new preview UX.
Also happens in RC 7.0.0 rc.3.
Also happens in RC 7.0.0 rc.3.
Is it in v7.0.0 ?
If so I'll refer it to the team (though you have EE so have you contacted them internally?)
Yes, I checked now on our test system (RC 7.0.0) and I'm still seeing this too.
Yup, we do have EE but I quite often prefer GitHub because it may trigger answers from other RC maintainers too, which has been helpful in some obscure issues through the years.
I made a custom CSS change (cleanup), set the away timeout to one minute and follow the situation with RC 7.0.0 in production.
This bug happens really often but at the same it is pretty non-persistent.
Refresh always fixes it. But the status gets fixed eventually when using RC and doing other tasks meanwhile too.
I haven't been able to pinpoint it when; suddenly it just is back at green again. Possibly after the next 60 seconds timeout phase when I've been away from RC.
When I return to RC tab in browser I still see brief flash to green in RC 7.0.0 sometimes, and then it turns immediately back to Away-status in a fraction of second.
Edit: Confirmed that it is exactly when returning to RC tab and hovering mouse over the window that fixes it eventually. Meaning when it returns from the next Away state. With the exception that bug does not trigger that time.
Our other users have noticed this too by now, so it is not just my personal use case (which often contains all kinds of fiddling with things).
Confirmed in both Linux and Windows, Firefox and desktop client.
I'll start testing with open.rocket.chat if it is reproducible there.
This was fully reproducible with Chrome at https://open.rocket.chat .
The same symptoms too;
- Away time trigger set to 61 seconds.
- Chrome and open.rocket.chat page visible without focus.
- After you spot status changing to Away state, hover your mouse on top of window and channel and go to that channel with mouse click.
- Randomly instead of presence turning to green blob, it flashes very fast to green, and then sticks to orange away status.
- No fiddling with channels and sending messages makes the presence indicator to go green at any point. (Unless you are away for a minute again and this time it may work properly.)
Still almost constantly happens in RC 7.1.0.
I'll ask Casals to look.
I found a dirty workaround to fix the problem.
https://github.com/RocketChat/Rocket.Chat/blob/86a21b5784ad676907dd8f90f45a3f7aacc4a97e/apps/meteor/packages/meteor-user-presence/client/client.js#L104
If I comment out line#104 , line#105 and line#106 in the client.js , the user status will change to online as expected.
async 'UserPresence:online'() {
const user = await Meteor.userAsync();
/**
if (user && user.status !== 'online' && user.statusDefault === 'online') {
await Meteor.users.updateAsync({ _id: Meteor.userId() }, { $set: { status: 'online' } });
}
**/
UserPresence.runCallbacks(user, 'online');
},
As 'UserPresence:away' does not call Meteor.users.updateAsync, maybe we can update the user status in the ServerMethod?
Still an issue in RC 7.3.1.
Still an issue in RC 7.3.1.
had any response from support?
I'll flag Casals again.
taking to internal engineering team
Still happens in RC 7.7.0.
Bumped with team
May be early, but I think this may have got fixed by RC 7.8.1. Or at least it does not happen as constantly.
I confirm this seems to have been fixed in RC 7.8.x. Issue closed.