Skip to content
Snippets Groups Projects
  1. Nov 16, 2021
  2. Nov 15, 2021
  3. Nov 12, 2021
  4. Nov 09, 2021
  5. Nov 05, 2021
  6. Nov 02, 2021
  7. Nov 01, 2021
  8. Oct 27, 2021
  9. Oct 15, 2021
  10. Oct 13, 2021
  11. Oct 12, 2021
  12. Oct 06, 2021
  13. Oct 05, 2021
    • David Robertson's avatar
      Fix potential leak of per-room profiles when the user dir is rebuilt. (#10981) · 4f00432c
      David Robertson authored
      
      There are two steps to rebuilding the user directory:
      
      1. a scan over rooms, followed by
      2. a scan over local users.
      
      The former reads avatars and display names from the `room_memberships`
      table and therefore contains potentially private avatars and
      display names. The latter reads from the the `profiles` table which only
      contains public data; moreover it will overwrite any private profiles
      that the rooms scan may have written to the user directory. This means
      that the rebuild could leak private user while the rebuild was in
      progress, only to later cover up the leaks once the rebuild had completed.
      
      This change skips over local users when writing user_directory rows
      when scanning rooms. Doing so means that it'll take longer for a rebuild
      to make local users searchable, which is unfortunate. I think a future
      PR can improve this by swapping the order of the two steps above. (And
      indeed there's more to do here, e.g. copying from `profiles` without
      going via Python.)
      
      Small tidy-ups while I'm here:
      
      * Remove duplicated code from test_initial. This was meant to be pulled into `purge_and_rebuild_user_dir`.
      * Move `is_public` before updating sharing tables. No functional change; it's still before the first read of `is_public`.
      * Don't bother creating a set from dict keys. Slightly nicer and makes the code simpler.
      
      Co-authored-by: default avatarRichard van der Hoff <1389908+richvdh@users.noreply.github.com>
      4f00432c
  14. Oct 04, 2021
    • David Robertson's avatar
      Consistently exclude from user_directory (#10960) · f7b034a2
      David Robertson authored
      * 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: default avatarRichard van der Hoff <1389908+richvdh@users.noreply.github.com>
      f7b034a2
  15. Oct 01, 2021
  16. Sep 30, 2021
  17. Sep 29, 2021
  18. Sep 23, 2021
  19. Sep 22, 2021
  20. Sep 14, 2021
  21. Sep 08, 2021
  22. Sep 01, 2021
  23. Aug 17, 2021
  24. Aug 04, 2021
  25. Aug 02, 2021
  26. Jul 26, 2021
  27. Jul 20, 2021
  28. Jul 13, 2021
  29. Jun 29, 2021
  30. Jun 22, 2021
  31. Jun 17, 2021
  32. Jun 01, 2021
    • Richard van der Hoff's avatar
      add a cache to have_seen_event (#9953) · b4b2fd2e
      Richard van der Hoff authored
      Empirically, this helped my server considerably when handling gaps in Matrix HQ. The problem was that we would repeatedly call have_seen_events for the same set of (50K or so) auth_events, each of which would take many minutes to complete, even though it's only an index scan.
      b4b2fd2e
  33. May 21, 2021
Loading