Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client presence update creates flood of presence updates from gateway #256

Open
dazzzl opened this issue Jan 4, 2018 · 8 comments
Open

Comments

@dazzzl
Copy link

dazzzl commented Jan 4, 2018

First, it is related to #218 and #204, but it is a general problem. Therefore, I created a new issue.

Setup:
Prosody trunk (~May 2017) with latest Spectrum in gateway mode.

Problem:
On resource changes the status (e.g., available -> away or away -> available). Prosody spread this update to all buddies in the roster. Spectrum receives for each buddy in this gateway a presence update. The answer of Spectrum is an update of the presence of the gateway for all resources, even if the gateway status was not changed. The result is: If one resource is changing the presence status, all resources gets a flood of duplicated presence updates for the gateway.

Expected result:
Only on presence update per resource and only if the gateway status is changed.

Solution:
I made a quick hack in User::handlePresence Line 302:

if (presence->getTo().toString().find("@") != std::string::npos) return;

@languitar
Copy link
Contributor

Is there no chance to fix this in Spectrum? I think I am experiencing the same thing with ejabberd, but I have to check this again before I can say something real.

@dos1
Copy link
Contributor

dos1 commented Mar 22, 2018

I can confirm that presence flooding happens with ejabberd as well.

@thundergreen
Copy link
Contributor

Don't know if this isbreoated to this topic but I get annoying leave messages for my discord transport .I think its spectrum related

@dos1
Copy link
Contributor

dos1 commented Apr 4, 2018

With ~600 contacts and 2+ resources usually connected this issue gets really hard to stand, so as a hacky personal workaround I'm using ACLs to prevent presence updates from reaching Spectrum contacts (they still reach the transport itself). In its effects it should be analogous to the workaround as presented by @dazzzl, but it doesn't need patching and recompiling :)

@languitar
Copy link
Contributor

@dos1 could you explain how the ACLs work. Maybe I can use that as a workaround then, too.

@dos1
Copy link
Contributor

dos1 commented Apr 4, 2018

I denied both "Presence-Out" and "Presence-In" because reasons, but generally you just need to block Presence-Out.

@edhelas
Copy link
Contributor

edhelas commented Oct 2, 2019

I'm also experiencing the same issue, would it be possible to fix it ? It creates a lot of useless traffic on the server.

@thundergreen
Copy link
Contributor

Any idea how to fix that with ejabberd ACL? Or how is it supposed to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants