mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-17 01:33:53 +01:00
Add some debug logging for device list handling
This commit is contained in:
parent
fde26e47d6
commit
c633fc02d7
1 changed files with 38 additions and 2 deletions
|
@ -402,6 +402,12 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
user_id, device_ids, list(hosts)
|
||||
)
|
||||
|
||||
for device_id in device_ids:
|
||||
logger.debug(
|
||||
"Notifying about update %r/%r, ID: %r", user_id, device_id,
|
||||
position,
|
||||
)
|
||||
|
||||
room_ids = yield self.store.get_rooms_for_user(user_id)
|
||||
|
||||
yield self.notifier.on_new_event(
|
||||
|
@ -409,7 +415,7 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
)
|
||||
|
||||
if hosts:
|
||||
logger.info("Sending device list update notif to: %r", hosts)
|
||||
logger.info("Sending device list update notif for %r to: %r", user_id, hosts)
|
||||
for host in hosts:
|
||||
self.federation_sender.send_device_messages(host)
|
||||
|
||||
|
@ -479,15 +485,26 @@ class DeviceListEduUpdater(object):
|
|||
|
||||
if get_domain_from_id(user_id) != origin:
|
||||
# TODO: Raise?
|
||||
logger.warning("Got device list update edu for %r from %r", user_id, origin)
|
||||
logger.warning(
|
||||
"Got device list update edu for %r/%r from %r",
|
||||
user_id, device_id, origin,
|
||||
)
|
||||
return
|
||||
|
||||
room_ids = yield self.store.get_rooms_for_user(user_id)
|
||||
if not room_ids:
|
||||
# We don't share any rooms with this user. Ignore update, as we
|
||||
# probably won't get any further updates.
|
||||
logger.warning(
|
||||
"Got device list update edu for %r/%r, but don't share a room",
|
||||
user_id, device_id,
|
||||
)
|
||||
return
|
||||
|
||||
logger.debug(
|
||||
"Received device list update for %r/%r", user_id, device_id,
|
||||
)
|
||||
|
||||
self._pending_updates.setdefault(user_id, []).append(
|
||||
(device_id, stream_id, prev_ids, edu_content)
|
||||
)
|
||||
|
@ -505,10 +522,18 @@ class DeviceListEduUpdater(object):
|
|||
# This can happen since we batch updates
|
||||
return
|
||||
|
||||
for device_id, stream_id, prev_ids, content in pending_updates:
|
||||
logger.debug(
|
||||
"Handling update %r/%r, ID: %r, prev: %r ",
|
||||
user_id, device_id, stream_id, prev_ids,
|
||||
)
|
||||
|
||||
# Given a list of updates we check if we need to resync. This
|
||||
# happens if we've missed updates.
|
||||
resync = yield self._need_to_do_resync(user_id, pending_updates)
|
||||
|
||||
logger.debug("Need to re-sync devices for %r? %r", user_id, resync)
|
||||
|
||||
if resync:
|
||||
# Fetch all devices for the user.
|
||||
origin = get_domain_from_id(user_id)
|
||||
|
@ -561,6 +586,12 @@ class DeviceListEduUpdater(object):
|
|||
)
|
||||
devices = []
|
||||
|
||||
for device in devices:
|
||||
logger.debug(
|
||||
"Handling resync update %r/%r, ID: %r",
|
||||
user_id, device["device_id"], stream_id,
|
||||
)
|
||||
|
||||
yield self.store.update_remote_device_list_cache(
|
||||
user_id, devices, stream_id,
|
||||
)
|
||||
|
@ -593,6 +624,11 @@ class DeviceListEduUpdater(object):
|
|||
user_id
|
||||
)
|
||||
|
||||
logger.debug(
|
||||
"Current extremity for %r: %r",
|
||||
user_id, extremity,
|
||||
)
|
||||
|
||||
stream_id_in_updates = set() # stream_ids in updates list
|
||||
for _, stream_id, prev_ids, _ in updates:
|
||||
if not prev_ids:
|
||||
|
|
Loading…
Reference in a new issue