mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-08 20:54:57 -04:00
Only fetch thread participation for events with threads. (#12228)
We fetch the thread summary in two phases: 1. The summary that is shared by all users (count of messages and latest event). 2. Whether the requesting user has participated in the thread. There's no use in attempting step 2 for events which did not return a summary from step 1.
This commit is contained in:
parent
2177e356bc
commit
80e0e1f35e
4 changed files with 289 additions and 245 deletions
|
@ -857,7 +857,9 @@ class RelationsWorkerStore(SQLBaseStore):
|
|||
summaries = await self._get_thread_summaries(events_by_id.keys())
|
||||
# Only fetch participated for a limited selection based on what had
|
||||
# summaries.
|
||||
participated = await self._get_threads_participated(summaries.keys(), user_id)
|
||||
participated = await self._get_threads_participated(
|
||||
[event_id for event_id, summary in summaries.items() if summary], user_id
|
||||
)
|
||||
for event_id, summary in summaries.items():
|
||||
if summary:
|
||||
thread_count, latest_thread_event, edit = summary
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue