anonymousland-synapse/tests/rest/client
David Robertson f7b034a24b
Consistently exclude from user_directory (#10960)
* 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>
2021-10-04 11:45:51 +00:00
..
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_account.py Use direct references for configuration variables (part 7). (#10959) 2021-10-04 07:18:54 -04:00
test_auth.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_capabilities.py Use direct references for configuration variables (part 6). (#10916) 2021-09-29 06:44:15 -04:00
test_consent.py Add reactor to SynapseRequest and fix up types. (#10868) 2021-09-24 11:01:25 +01:00
test_directory.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_ephemeral_message.py Flatten the synapse.rest.client package (#10600) 2021-08-17 11:57:58 +00:00
test_events.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_filter.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_groups.py Merge branch 'master' into develop 2021-08-31 14:09:48 +01:00
test_identity.py Use direct references for configuration variables (part 7). (#10959) 2021-10-04 07:18:54 -04:00
test_keys.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_login.py Consistently exclude from user_directory (#10960) 2021-10-04 11:45:51 +00:00
test_password_policy.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_power_levels.py Validate new m.room.power_levels events (#10232) 2021-08-26 17:07:58 +01:00
test_presence.py Use direct references for configuration variables (part 6). (#10916) 2021-09-29 06:44:15 -04:00
test_profile.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_push_rule_attrs.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_redactions.py Flatten the synapse.rest.client package (#10600) 2021-08-17 11:57:58 +00:00
test_register.py Use direct references for configuration variables (part 7). (#10959) 2021-10-04 07:18:54 -04:00
test_relations.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_report_event.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_retention.py Flatten the synapse.rest.client package (#10600) 2021-08-17 11:57:58 +00:00
test_rooms.py Add a spamchecker callback to allow or deny room creation based on invites (#10898) 2021-09-24 16:38:23 +02:00
test_sendtodevice.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_shadow_banned.py Add type hints for event streams. (#10856) 2021-09-21 13:34:26 -04:00
test_shared_rooms.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_sync.py Flatten tests/rest/client/{v1,v2_alpha} too (#10667) 2021-08-20 17:50:44 +01:00
test_third_party_rules.py Test that state events sent by modules correctly end up in the room's state (#10835) 2021-09-21 17:40:20 +02:00
test_transactions.py Use mock from the stdlib. (#9772) 2021-04-09 13:44:38 -04:00
test_typing.py Add type hints for event streams. (#10856) 2021-09-21 13:34:26 -04:00
test_upgrade_room.py Handle room upgrades for spaces (#10774) 2021-09-10 07:30:05 -04:00
utils.py Add reactor to SynapseRequest and fix up types. (#10868) 2021-09-24 11:01:25 +01:00