mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 17:55:06 -04:00
Stop user directory from failing if it encounters users not in the users
table. (#11053)
The following scenarios would halt the user directory updater: - user joins room - user leaves room - user present in room which switches from private to public, or vice versa. for two classes of users: - appservice senders - users missing from the user table. If this happened, the user directory would be stuck, unable to make forward progress. Exclude both cases from the user directory, so that we ignore them. Co-authored-by: Eric Eastwood <erice@element.io> Co-authored-by: reivilibre <oliverw@matrix.org> Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
This commit is contained in:
parent
1db9282dfa
commit
b83e822556
13 changed files with 918 additions and 90 deletions
|
@ -256,7 +256,7 @@ class UserDirectoryInitialPopulationTestcase(HomeserverTestCase):
|
|||
users = self.get_success(self.user_dir_helper.get_users_in_user_directory())
|
||||
self.assertEqual(users, {u1, u2, u3})
|
||||
|
||||
# The next three tests (test_population_excludes_*) all set up
|
||||
# The next four tests (test_population_excludes_*) all set up
|
||||
# - A normal user included in the user dir
|
||||
# - A public and private room created by that user
|
||||
# - A user excluded from the room dir, belonging to both rooms
|
||||
|
@ -364,6 +364,21 @@ class UserDirectoryInitialPopulationTestcase(HomeserverTestCase):
|
|||
# Check the AS user is not in the directory.
|
||||
self._check_room_sharing_tables(user, public, private)
|
||||
|
||||
def test_population_excludes_appservice_sender(self) -> None:
|
||||
user = self.register_user("user", "pass")
|
||||
token = self.login(user, "pass")
|
||||
|
||||
# Join the AS sender to rooms owned by the normal user.
|
||||
public, private = self._create_rooms_and_inject_memberships(
|
||||
user, token, self.appservice.sender
|
||||
)
|
||||
|
||||
# Rebuild the directory.
|
||||
self._purge_and_rebuild_user_dir()
|
||||
|
||||
# Check the AS sender is not in the directory.
|
||||
self._check_room_sharing_tables(user, public, private)
|
||||
|
||||
def test_population_conceals_private_nickname(self) -> None:
|
||||
# Make a private room, and set a nickname within
|
||||
user = self.register_user("aaaa", "pass")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue