Fix logging to lie less

This commit is contained in:
Mark Haines 2015-12-14 15:19:37 +00:00
parent 28c5181dfe
commit 2acae8300f

View File

@ -351,8 +351,6 @@ class SyncRestServlet(RestServlet):
continue continue
prev_event_id = timeline_event.unsigned.get("replaces_state", None) prev_event_id = timeline_event.unsigned.get("replaces_state", None)
logger.debug("Replacing %s with %s in state dict",
timeline_event.event_id, prev_event_id)
prev_content = timeline_event.unsigned.get('prev_content') prev_content = timeline_event.unsigned.get('prev_content')
prev_sender = timeline_event.unsigned.get('prev_sender') prev_sender = timeline_event.unsigned.get('prev_sender')
@ -363,8 +361,17 @@ class SyncRestServlet(RestServlet):
# If this is the case the we ignore the previous event. This will # If this is the case the we ignore the previous event. This will
# cause the displayname calculations on the client to be incorrect # cause the displayname calculations on the client to be incorrect
if prev_event_id is None or not prev_content or not prev_sender: if prev_event_id is None or not prev_content or not prev_sender:
logger.debug(
"Removing %r from the state dict, as it is missing "
" prev_content (prev_event_id=%r)",
timeline_event.event_id, prev_event_id
)
del result[event_key] del result[event_key]
else: else:
logger.debug(
"Replacing %r with %r in state dict",
timeline_event.event_id, prev_event_id
)
result[event_key] = FrozenEvent({ result[event_key] = FrozenEvent({
"type": timeline_event.type, "type": timeline_event.type,
"state_key": timeline_event.state_key, "state_key": timeline_event.state_key,