Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

[Presence] Flicker when using multiple devices simultaneously #15879

Closed
realtyem opened this issue Jul 5, 2023 · 1 comment
Closed

[Presence] Flicker when using multiple devices simultaneously #15879

realtyem opened this issue Jul 5, 2023 · 1 comment

Comments

@realtyem
Copy link
Contributor

realtyem commented Jul 5, 2023

I have not seen this in person, but I was informed this is a thing that happens.

From out-of-band

Well, in my case when I implemented a button to set your presence in Nheko, it killed my server, because I had an Element open somewhere and it was flip-flopping between 2 presence states at like 50ms per state

From #9415

Currently I sometimes have 2 clients fighting over presence changes and generating a lot of EDUs in rapid fashing, while some smoothing would be nice. Possibly synapse should just track presence per device and then send the "highest" presence, i.e. busy > online > unavailable > offline.

From #3971 (Although I feel some of this has been mitigated already, it seemed relevant)

An easy way to trigger it is to use the riot-ios app. Just opening the app and then sending it to the background would cause it to hit /_matrix/client/r0/presence/{userId}/status with PUT requests (either updating presence to online or to unavailable.. and after some more inactivity, to offline by a Synapse background task, it seems).
Doing that would cause 100% CPU for a while. I imagine Synapse tries to notify many other servers about the presence change. While this (non-important thing) is going on, Synapse would be slow to respond to other requests.
If I just keep alternating between backgrounding and foregrounding the riot-ios app, I can effectively keep my homeserver at 100% CPU.
Normally though, a few seconds after backgrounding the app (which sets my presence as unavailable), due to a subsequent foregrounding of the app or due to a /sync by another client of mine (on desktop or something), my presence status would change back to online and cause the same thing once again.

CC @nico-famedly

I'm not certain there is a way of reliably testing for this, and there is no guarantees on a video capturing it within the space of a frame(depending on factors such as speed of the system running the server).

It's very possible that fixing #9415 will fix this as well, or at least make it much better.

@H-Shay
Copy link
Contributor

H-Shay commented Jul 5, 2023

Unfortunately without logs and or anything concrete this is essentially non-actionable - if you can provide logs and screenshots of a specific example of this behavior happening we could investigate, but until then I am going to close this issue as we aren't able to take action on it.

@H-Shay H-Shay closed this as completed Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants