Skip to content

Commit

Permalink
Add some paranoia logging
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Feb 11, 2016
1 parent 7718303 commit a1b7902
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions synapse/rest/client/v2_alpha/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ._base import client_v2_patterns

import copy
import itertools
import logging

import ujson as json
Expand Down Expand Up @@ -288,6 +289,15 @@ def serialize(event):

state_events = state_dict.values()

for event in itertools.chain(state_events, timeline_events):
# We've had bug reports that events were coming down under the
# wrong room.
if event.room_id != room.room_id:
logger.warn(
"Event %r is under room %r instead of %r",
event.event_id, room.room_id, event.room_id,
)

serialized_state = [serialize(e) for e in state_events]
serialized_timeline = [serialize(e) for e in timeline_events]

Expand Down

0 comments on commit a1b7902

Please sign in to comment.