RosterEntry#getGroups causing a roster reload

Description

René Treffer wrotes:

So here is what many users do:
1. Disable roster loading on login
2. getRoster
3. Iterate over all Entries
4. call getGroups on every Entry, thus reloading their roster multiple times

This was made possible by the connection.roster -> connection.getRoster change. I actually think the getRoster logic is broken, as it should never reload the roster unless it need initialization (reload is getRoster().reload(), right?).

Environment

None

Activity

Show:
Guenther Niess
March 25, 2010, 1:33 AM

I don't really want to change the Connection#getRoster logic, so I've fixed it within the RosterEntry and Roster class and committed a patch to 11670.

Guenther Niess
March 25, 2010, 1:29 AM

This issue was introduced by SMACK-279.

Guenther Niess
March 23, 2010, 1:09 AM

Your right, I should have a more detailed look into this.

René Treffer
March 22, 2010, 9:17 PM

The iteration over all entries + getGroup is quite common. It's the usual way to build your roster.

I've actually a problem with "loadRosterOnLogin" meaning "don't reload the roster all the time". Especially as getGroups > getRoster was introduced with the BOSH merge :)

Guenther Niess
March 22, 2010, 6:50 PM

I'm not sure that the described scenario is widely-used and if we change the getRoster logic, we will break some applications or get problems with the reconnection logic. I think it was intended that the most users will iterate over all Roster#getGroups and RosterGroup#getEntries. But the described scenario is possible and produces too much traffic.

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Guenther Niess

Reporter

Guenther Niess