Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Presence indicator in the profile element stuck at away status

Open Gummikavalier opened this issue 1 year ago • 14 comments

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:

  1. Set the status to Online from the top left profile menu.
  2. Do not use the browser; wait that idle timeout turns the user status from Online to Away status
  3. 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.

Gummikavalier avatar Oct 25 '24 18:10 Gummikavalier

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?)

reetp avatar Nov 11 '24 13:11 reetp

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.

Gummikavalier avatar Nov 11 '24 18:11 Gummikavalier

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.

Screenshot from 2024-11-15 20-53-45

Gummikavalier avatar Nov 15 '24 18:11 Gummikavalier

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.

Gummikavalier avatar Nov 18 '24 18:11 Gummikavalier

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.

Gummikavalier avatar Nov 29 '24 09:11 Gummikavalier

This was fully reproducible with Chrome at https://open.rocket.chat .

The same symptoms too;

  1. Away time trigger set to 61 seconds.
  2. Chrome and open.rocket.chat page visible without focus.
  3. 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.
  4. Randomly instead of presence turning to green blob, it flashes very fast to green, and then sticks to orange away status.
  5. 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.)

Gummikavalier avatar Nov 29 '24 12:11 Gummikavalier

Still almost constantly happens in RC 7.1.0.

Gummikavalier avatar Dec 04 '24 18:12 Gummikavalier

I'll ask Casals to look.

reetp avatar Dec 11 '24 10:12 reetp

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?

imunique-ZJ avatar Dec 25 '24 15:12 imunique-ZJ

Still an issue in RC 7.3.1.

Gummikavalier avatar Feb 19 '25 08:02 Gummikavalier

Still an issue in RC 7.3.1.

had any response from support?

I'll flag Casals again.

reetp avatar Feb 19 '25 10:02 reetp

taking to internal engineering team

casalsgh avatar Feb 19 '25 12:02 casalsgh

Still happens in RC 7.7.0.

Gummikavalier avatar Jun 05 '25 07:06 Gummikavalier

Bumped with team

reetp avatar Jun 06 '25 11:06 reetp

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.

Gummikavalier avatar Jul 20 '25 12:07 Gummikavalier

I confirm this seems to have been fixed in RC 7.8.x. Issue closed.

Gummikavalier avatar Jul 31 '25 10:07 Gummikavalier