Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Consistently exclude from user_directory, round 2 #10960

Merged
merged 12 commits into from
Oct 4, 2021

Commits on Sep 30, 2021

  1. 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 callers 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.
    
    Broken-off from #10914.
    
    ----
    
    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](#10914 (comment)).
    * 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.
    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    b9638c9 View commit details
    Browse the repository at this point in the history
  2. Introduce register_appservice_user to HomeserverTestCase

    already used in one test suite, and I want to make use of it shortly for
    the user_directory tests.
    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    3f969d1 View commit details
    Browse the repository at this point in the history
  3. Check appservice profile changes are ignored

    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    76751aa View commit details
    Browse the repository at this point in the history
  4. test population excludes users it should

    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    010314d View commit details
    Browse the repository at this point in the history
  5. Extra assertion in test_initial

    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    a8a12a5 View commit details
    Browse the repository at this point in the history
  6. Changelog

    David Robertson committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    8b614d7 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2021

  1. Improve docstring of register_appservice_user

    David Robertson committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    8c41d2e View commit details
    Browse the repository at this point in the history
  2. Use access_token parameter

    David Robertson committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    667ec6e View commit details
    Browse the repository at this point in the history
  3. Assert 200 response!

    David Robertson committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    c8bb561 View commit details
    Browse the repository at this point in the history
  4. Add tests which interrogate room sharing tables

    David Robertson committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    aeeb697 View commit details
    Browse the repository at this point in the history
  5. Correctly exclude from users_who_share_private_room

    David Robertson committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    c090ab6 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2021

  1. setup is not a verb

    Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
    David Robertson and richvdh authored Oct 4, 2021
    Configuration menu
    Copy the full SHA
    3dc823f View commit details
    Browse the repository at this point in the history