sockethub / sockethub

A multi-protocol gateway for the Web using ActivityStream messages.
http://sockethub.org
GNU Lesser General Public License v3.0
381 stars 46 forks source link

Get room attendance list as single message #277

Open galfert opened 3 years ago

galfert commented 3 years ago

When asking for an attendance list of a room (via observe), Sockethub used to respond with a single message containing all the users of that room.

I think with introduction of the user roles this changed, Sockethub now sends separate messages for every single user. For rooms with a large number of users, this can have a significant performance impact for the client that has to process all those messages.

Is there any reason that prevents us from changing the behavior back to sending a single message?

silverbucket commented 3 years ago

@galfert this was something that @gregkare and I worked on explicity last year, converting each attendance entry to an object, rather than a lot string of usernames. I can't remember everything we discussed at the time but it seemed like the right thing to do there - and the old way had issues as well (i believe you might have said something about not getting detailed information about any of the users, but I can't remember exactly.

Anyone else remember any other details about this?

galfert commented 3 years ago

Yes, that is correct. But couldn't we just have a list of (detailed) user objects in a single message instead of strings with just the username?

silverbucket commented 3 years ago

@galfert are you 100% sure that the overhead is with receiving the separate payloads rather than just the fact that the app has to process all of the objects to get the user info?

galfert commented 3 years ago

Things we discussed during the Kosmos summit to investigate, in order to find the reason and possible solutions to the performance problem:

raucao commented 2 years ago

Just btw, the attendance list used in Hyperchannel atm is an inline list from an attendance message, but the list is just username strings.

However, it also receives separate presence messages, which are also processed.

raucao commented 2 years ago

Also relevant perhaps: https://www.w3.org/TR/activitystreams-core/#collections