summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-12-23 14:04:50 +0000
committerGitHub <noreply@github.com>2022-12-23 14:04:50 +0000
commita52822d39c866b4d5e6d2a0176f29ae49bf3f8e9 (patch)
treeb6599d8a0998d853370993eae925f333c6a38a8e /synapse
parentCheck sqlite database file exists before porting. (#14692) (diff)
downloadsynapse-a52822d39c866b4d5e6d2a0176f29ae49bf3f8e9.tar.xz
Log to-device msgids when we return them over /sync (#14724)
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/sync.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 7d6a653747..4fa480262b 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -37,6 +37,7 @@ from synapse.api.presence import UserPresenceState
 from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
 from synapse.events import EventBase
 from synapse.handlers.relations import BundledAggregations
+from synapse.logging import issue9533_logger
 from synapse.logging.context import current_context
 from synapse.logging.opentracing import (
     SynapseTags,
@@ -1623,13 +1624,18 @@ class SyncHandler:
                     }
                 )
 
-            logger.debug(
-                "Returning %d to-device messages between %d and %d (current token: %d)",
-                len(messages),
-                since_stream_id,
-                stream_id,
-                now_token.to_device_key,
-            )
+            if messages and issue9533_logger.isEnabledFor(logging.DEBUG):
+                issue9533_logger.debug(
+                    "Returning to-device messages with stream_ids (%d, %d]; now: %d;"
+                    " msgids: %s",
+                    since_stream_id,
+                    stream_id,
+                    now_token.to_device_key,
+                    [
+                        message["content"].get(EventContentFields.TO_DEVICE_MSGID)
+                        for message in messages
+                    ],
+                )
             sync_result_builder.now_token = now_token.copy_and_replace(
                 StreamKeyType.TO_DEVICE, stream_id
             )