element-hq / element-hq/synapse

When populating the user directory, query remote servers for user profiles instead of leaking the profiles in private rooms. [rei:userdirpriv]

Open
#15,091 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#15091](https://github.com/matrix-org/synapse/pull/15091).

---

Fixes: #5677

Follows: #14756

Base: `rei/userdirpriv2_refresh_remotes`

This pull request is commit-by-commit review friendly.

Original commit schedule, with full messages:


  1. Rename method to make obvious it only applies to local users


  2. Add another temporary table to the user directory background update for storing remote users needing lookup


  3. Don't add private remote users straight to the user directory \
    Instead, queue them up to be added to the stale profile queue.


  4. Add a background update stage to sort the remote users into the stale profile queue as appropriate


  5. (ugly?) Kick off the fetching of remote profiles once ready


  6. When we start populating the user directory, clear out the old tables first if they're there


  7. When rebuilding user dir, schedule the new task


  8. Schedule a user directory rebuild


### Stacked PR Chain: rei:userdirpriv
| PR | Title | Status | Merges Into |
|:--:|:------|:-------|:-------------:|
|#14755|Preparatory work to fix the user directory assuming that any remote membership state events represent a profile change.|![](https://img.shields.io/github/pulls/detail/state/matrix-org/synapse/14755?label=Approved)|-|
|#14756|Refresh remote profiles that have been marked as stale, in order to fill the user directory.|![](https://img.shields.io/github/pulls/detail/state/matrix-org/synapse/14756?label=Pending)|#14755|
|#15091|👉 *(Draft) When populating the user directory, query remote servers for user profiles instead of leaking the profiles in private rooms.*|![](https://img.shields.io/github/pulls/detail/state/matrix-org/synapse/15091?label=Pending)|#14756|

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.