Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 12c11ae

Browse files
author
David Robertson
committed
Exclude partial state rooms during eager sync
using the mechanism established in the previous commit
1 parent 9cf40f7 commit 12c11ae

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

synapse/handlers/sync.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,12 +1378,19 @@ async def generate_sync_result(
13781378
else:
13791379
mutable_joined_room_ids.discard(room_id)
13801380

1381+
mutable_rooms_to_exclude = set(self.rooms_to_exclude_globally)
1382+
if not sync_config.filter_collection.lazy_load_members():
1383+
# Exclude all partially stated rooms from this sync.
1384+
for room_id in mutable_joined_room_ids:
1385+
if await self.store.is_partial_state_room(room_id):
1386+
mutable_rooms_to_exclude.add(room_id)
1387+
13811388
# Now we have our list of joined room IDs, exclude as configured and freeze
13821389
joined_room_ids = frozenset(
13831390
(
13841391
room_id
13851392
for room_id in mutable_joined_room_ids
1386-
if room_id not in self.rooms_to_exclude_globally
1393+
if room_id not in mutable_rooms_to_exclude
13871394
)
13881395
)
13891396

@@ -1400,7 +1407,7 @@ async def generate_sync_result(
14001407
since_token=since_token,
14011408
now_token=now_token,
14021409
joined_room_ids=joined_room_ids,
1403-
excluded_room_ids=frozenset(self.rooms_to_exclude_globally),
1410+
excluded_room_ids=frozenset(mutable_rooms_to_exclude),
14041411
membership_change_events=membership_change_events,
14051412
)
14061413

0 commit comments

Comments
 (0)