Increase test coverage for GroupManager
This adds a couple of tests for obvious gaps in pre-existing test coverage:
- Verify that when a group's sharing target list removes a group, users of that removed group immediately stop seeing the shared group.
- Verify that toggling sharing with everybody is immediately reflected in per-user shared-group results.
OF-3285: Ensure changes to group sharing visibility immediately reflected in users' contact lists
Fixes a rather silly bug around cache eviction, added extensive unit test coverage.
OF-3286: Unify GroupManager metadata locking
Replace the fragmented metadata locking scheme in GroupManager with a single shared lock around groupMetaCache access. This removes the previous mix of separate lock objects and per-user interning, making cache synchronization easier to reason about and reducing the risk of inconsistent updates.
Adds unit tests that verify some of the concurrent behavior.
Harden GroupManager unit test around 'share with own group'
The 'share with own group' option is currently persisted as 'share with list of groups' where the value is only the name of the own group.
Although implementation-wise, this is identical to what's already being tested, behavioral, this is different. To capture bugs introduced by potential future changes, this commit adds tests for the 'share with own group' case.
OF-3287: evict per-user group caches for source group members
Ensure cache invalidation also includes members/admins of the group being processed, not only groups returned by shared-group traversal.
Previously, `evictCachedUsersForGroup(...)` could miss users in the source group (especially non-shared groups), leaving stale cache entries. This caused group create/rename/delete and shared-roster target-list changes to not be reflected immediately for affected users.