From a1b79029443c2edabd90ec3cd372443b44079c8e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 11 Feb 2016 09:22:37 +0000 Subject: Add some paranoia logging --- synapse/rest/client/v2_alpha/sync.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'synapse/rest') diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index 140ce2704b..accbc6cfac 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -28,6 +28,7 @@ from synapse.api.errors import SynapseError from ._base import client_v2_patterns import copy +import itertools import logging import ujson as json @@ -288,6 +289,15 @@ class SyncRestServlet(RestServlet): 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] -- cgit 1.4.1