RosterEntry#getGroups causing a roster reload
René Treffer wrotes:
So here is what many users do:
1. Disable roster loading on login
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?).
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.
This issue was introduced by SMACK-279.
Your right, I should have a more detailed look into this.
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 :)
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.