f7b034a24b
* Introduce `should_include_local_users_in_dir` We exclude three kinds of local users from the user_directory tables. At present we don't consistently exclude all three in the same places. This commit introduces a new function to gather those exclusion conditions together. Because we have to handle local and remote users in different ways, I've made that function only consider the case of remote users. It's the caller's responsibility to make the local versus remote distinction clear and correct. A test fixup is required. The test now hits a path which makes db queries against the users table. The expected rows were missing, because we were using a dummy user that hadn't actually been registered. We also add new test cases to covert the exclusion logic. ---- By my reading this makes these changes: * When an app service user registers or changes their profile, they will _not_ be added to the user directory. (Previously only support and deactivated users were excluded). This is consistent with the logic that rebuilds the user directory. See also [the discussion here](https://github.com/matrix-org/synapse/pull/10914#discussion_r716859548). * When rebuilding the directory, exclude support and disabled users from room sharing tables. Previously only appservice users were excluded. * Exclude all three categories of local users when rebuilding the directory. Previously `_populate_user_directory_process_users` didn't do any exclusion. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> |
||
---|---|---|
.. | ||
__init__.py | ||
oidc_test_key.p8 | ||
oidc_test_key.pub.pem | ||
test_admin.py | ||
test_appservice.py | ||
test_auth.py | ||
test_cas.py | ||
test_device.py | ||
test_directory.py | ||
test_e2e_keys.py | ||
test_e2e_room_keys.py | ||
test_federation.py | ||
test_message.py | ||
test_oidc.py | ||
test_password_providers.py | ||
test_presence.py | ||
test_profile.py | ||
test_receipts.py | ||
test_register.py | ||
test_room.py | ||
test_room_summary.py | ||
test_saml.py | ||
test_send_email.py | ||
test_stats.py | ||
test_sync.py | ||
test_typing.py | ||
test_user_directory.py |