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

Commit

Permalink
Faster joins: Omit device list updates from partial state rooms in /s…
Browse files Browse the repository at this point in the history
…ync (#15069)

...when lazy loading of members is not enabled. It's weird to notify
a client that another user's device list has changed when the client
doesn't think that they share a room.

Note that when a room is un-partial stated, device list updates are
emitted for every member in that room over /sync.

Signed-off-by: Sean Quah <seanq@matrix.org>
  • Loading branch information
squahtx authored Feb 14, 2023
1 parent cb26271 commit 463c19a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/15069.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faster joins: omit device list updates originating from partial state rooms in /sync responses without lazy loading of members enabled.
5 changes: 5 additions & 0 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,11 @@ async def generate_sync_result(
for room_id, is_partial_state in results.items()
if is_partial_state
)
membership_change_events = [
event
for event in membership_change_events
if not results.get(event.room_id, False)
]

# Incremental eager syncs should additionally include rooms that
# - we are joined to
Expand Down

0 comments on commit 463c19a

Please sign in to comment.