This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Consider using the "ignored_users" database table when filtering client events #11964
Labels
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
When ignoring a user, clients modify a
m.ignored_user_list
key in their account data (spec). Synapse will detect if this is happening, and modify an equivalent database table namedignored_users
. The idea is that the database table is faster to read from than digging the value out of account data.The table is used when calculating bulk push rules:
synapse/synapse/push/bulk_push_rule_evaluator.py
Lines 212 to 216 in 10a88ba
synapse/synapse/storage/databases/main/account_data.py
Lines 367 to 385 in af79517
Yet it is not used when ignored users are considered while filtering events for clients (i.e. for
/sync
):synapse/synapse/handlers/sync.py
Lines 1613 to 1634 in 64ec45f
synapse/synapse/visibility.py
Lines 89 to 91 in 4c20965
I'm not sure how much of an optimisation this would really be (as
get_global_account_data_by_type_for_user
is cached on key (user_id
,account_data_type
)). In addition, we'd need an index of theignorer_user
column, which doesn't currently exist.On the flip side - it is a nice idea to consolidate where we pull this information from.
The text was updated successfully, but these errors were encountered: