Fix a bug introduced in Synapse v1.0.0 whereby device list updates would not be sent to remote homeservers if there were too many to send at once. (#11729)

Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
This commit is contained in:
reivilibre 2022-01-12 15:21:13 +00:00 committed by GitHub
parent 1b1aed38e3
commit 22abfca8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 2 deletions

View file

@ -270,6 +270,10 @@ class DeviceWorkerStore(SQLBaseStore):
# The most recent request's opentracing_context is used as the
# context which created the Edu.
# This is the stream ID that we will return for the consumer to resume
# following this stream later.
last_processed_stream_id = from_stream_id
query_map = {}
cross_signing_keys_by_user = {}
for user_id, device_id, update_stream_id, update_context in updates:
@ -295,6 +299,8 @@ class DeviceWorkerStore(SQLBaseStore):
if update_stream_id > previous_update_stream_id:
query_map[key] = (update_stream_id, update_context)
last_processed_stream_id = update_stream_id
results = await self._get_device_update_edus_by_remote(
destination, from_stream_id, query_map
)
@ -307,7 +313,7 @@ class DeviceWorkerStore(SQLBaseStore):
# FIXME: remove this when enough servers have upgraded
results.append(("org.matrix.signing_key_update", result))
return now_stream_id, results
return last_processed_stream_id, results
def _get_device_updates_by_remote_txn(
self,