Skip to content
Snippets Groups Projects
Unverified Commit a52822d3 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Log to-device msgids when we return them over /sync (#14724)

parent 5c9be9c7
No related branches found
No related tags found
No related merge requests found
If debug logging is enabled, log the `msgid`s of any to-device messages that are returned over `/sync`.
...@@ -37,6 +37,7 @@ from synapse.api.presence import UserPresenceState ...@@ -37,6 +37,7 @@ from synapse.api.presence import UserPresenceState
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
from synapse.events import EventBase from synapse.events import EventBase
from synapse.handlers.relations import BundledAggregations from synapse.handlers.relations import BundledAggregations
from synapse.logging import issue9533_logger
from synapse.logging.context import current_context from synapse.logging.context import current_context
from synapse.logging.opentracing import ( from synapse.logging.opentracing import (
SynapseTags, SynapseTags,
...@@ -1623,13 +1624,18 @@ class SyncHandler: ...@@ -1623,13 +1624,18 @@ class SyncHandler:
} }
) )
logger.debug( if messages and issue9533_logger.isEnabledFor(logging.DEBUG):
"Returning %d to-device messages between %d and %d (current token: %d)", issue9533_logger.debug(
len(messages), "Returning to-device messages with stream_ids (%d, %d]; now: %d;"
since_stream_id, " msgids: %s",
stream_id, since_stream_id,
now_token.to_device_key, 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( sync_result_builder.now_token = now_token.copy_and_replace(
StreamKeyType.TO_DEVICE, stream_id StreamKeyType.TO_DEVICE, stream_id
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment