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

Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. #11730

Merged
merged 17 commits into from
Jan 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ async def get_device_updates_by_remote(
limit,
)

# len(updates) <= limit.
reivilibre marked this conversation as resolved.
Show resolved Hide resolved

# Return an empty list if there are no updates
if not updates:
return now_stream_id, []
Expand Down Expand Up @@ -302,11 +304,17 @@ async def get_device_updates_by_remote(

last_processed_stream_id = update_stream_id

# len(query_map) + len(cross_signing_keys_by_user) <= len(updates) here,
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
# so len(query_map) + len(cross_signing_keys_by_user) <= limit.

results = await self._get_device_update_edus_by_remote(
destination, from_stream_id, query_map
)

# add the updated cross-signing keys to the results list
# len(results) <= len(query_map) here,
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
# so len(results) + len(cross_signing_keys_by_user) <= limit.
reivilibre marked this conversation as resolved.
Show resolved Hide resolved

# Add the updated cross-signing keys to the results list
for user_id, result in cross_signing_keys_by_user.items():
result["user_id"] = user_id
results.append(("m.signing_key_update", result))
Expand Down