mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-08 23:32:46 -04:00
Fix caching behavior for relations push rules. (#12859)
By always returning all requested values from the function wrapped by cachedList. Otherwise implicit None values get added into the cache, which are unexpected.
This commit is contained in:
parent
4cbcd4a999
commit
759f9c09e1
3 changed files with 12 additions and 9 deletions
|
@ -13,7 +13,6 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from typing import (
|
||||
Collection,
|
||||
Dict,
|
||||
|
@ -810,7 +809,9 @@ class RelationsWorkerStore(SQLBaseStore):
|
|||
txn: LoggingTransaction,
|
||||
) -> Dict[str, Set[Tuple[str, str]]]:
|
||||
txn.execute(sql, [event_id] + rel_type_args)
|
||||
result = defaultdict(set)
|
||||
result: Dict[str, Set[Tuple[str, str]]] = {
|
||||
rel_type: set() for rel_type in relation_types
|
||||
}
|
||||
for rel_type, sender, type in txn.fetchall():
|
||||
result[rel_type].add((sender, type))
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue