When loading a group, getMembers is also used for each member of the group, in case it's a group. The problem is that it means the cache can quickly get filled with users and push the groups themself out, making the cache quite useless when there is a lot of users. To limit this effect, and as a bonus provide a new feature to the GroupManager, it would be interesting to introduce an isGroup(DocumentReference) and its corresponding cache which would be in charge of maintaining a big cache of boolean indicating if an entry is a group or not. |