summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2021-10-01 01:41:13 -0500
committerEric Eastwood <erice@element.io>2021-10-01 01:45:55 -0500
commitcafb1dcb6e64169d487e4008fe7c817ef6a1c6d2 (patch)
tree007edcacfd258df7670e96bf8f6b08ea3578976e
parentMerge branch 'develop' into madlittlemods/msc2716-resolve-state-for-all-histo... (diff)
downloadsynapse-cafb1dcb6e64169d487e4008fe7c817ef6a1c6d2.tar.xz
Remove debug logs
-rw-r--r--changelog.d/10938.bugfix1
-rw-r--r--synapse/handlers/federation_event.py7
-rw-r--r--synapse/handlers/message.py5
-rw-r--r--synapse/handlers/room.py8
-rw-r--r--synapse/rest/client/room.py4
-rw-r--r--synapse/rest/client/room_batch.py3
-rw-r--r--synapse/storage/databases/main/events.py27
-rw-r--r--synapse/storage/state.py17
8 files changed, 11 insertions, 61 deletions
diff --git a/changelog.d/10938.bugfix b/changelog.d/10938.bugfix
deleted file mode 100644
index 9cf0ea8788..0000000000
--- a/changelog.d/10938.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fix bug introduced in Synapse 1.44 which caused the experimental [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint to return a 500 error.
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index 51741b7854..95c125ed8a 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -1010,10 +1010,9 @@ class FederationEventHandler:
         room_version = await self._store.get_room_version(marker_event.room_id)
         create_event = await self._store.get_create_event_for_room(marker_event.room_id)
         room_creator = create_event.content.get(EventContentFields.ROOM_CREATOR)
-        if (
-            not room_version.msc2716_historical
-            and (not self._config.experimental.msc2716_enabled
-            or marker_event.sender != room_creator)
+        if not room_version.msc2716_historical and (
+            not self._config.experimental.msc2716_enabled
+            or marker_event.sender != room_creator
         ):
             return
 
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 9ef010545d..3651f097b9 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -930,7 +930,6 @@ class EventCreationHandler:
                 auth_event_ids=auth_event_ids,
                 depth=depth,
             )
-            #logger.info("auth_event_ids before=%s", auth_event_ids)
             auth_events = await self.store.get_events_as_list(auth_event_ids)
             # Create a StateMap[str]
             auth_event_state_map = {
@@ -942,7 +941,6 @@ class EventCreationHandler:
                 current_state_ids=auth_event_state_map,
                 for_verification=False,
             )
-            #logger.info("auth_event_ids after=%s", auth_event_ids)
 
         if prev_event_ids is not None:
             assert (
@@ -953,7 +951,6 @@ class EventCreationHandler:
         else:
             prev_event_ids = await self.store.get_prev_events_for_room(builder.room_id)
 
-
         # we now ought to have some prev_events (unless it's a create event).
         #
         # do a quick sanity check here, rather than waiting until we've created the
@@ -983,8 +980,6 @@ class EventCreationHandler:
 
             context = await self.state.compute_event_context(event, old_state=old_state)
 
-        logger.info("create_new_client_event type=%s, event_id=%s context=%s", event.type, event.event_id, context)
-
         if requester:
             context.app_service = requester.app_service
 
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 449fa2c725..de8e6e7c11 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -1164,22 +1164,14 @@ class RoomContextHandler:
         else:
             state_filter = StateFilter.all()
 
-        logger.info("get_event_context event_id=%s =====================", event_id)
         # XXX: why do we return the state as of the last event rather than the
         # first? Shouldn't we be consistent with /sync?
         # https://github.com/matrix-org/matrix-doc/issues/687
         event_id_to_get_state_from = last_event_id
 
-        # For historical events, we want to get the state at the specified event.
-        # TODO: maybe we can change how we're getting events_before and events_after
-        # here so it still works correctly without this hack
-        # if event.internal_metadata.is_historical():
-        #     event_id_to_get_state_from = event_id
-
         state = await self.state_store.get_state_for_events(
             [event_id_to_get_state_from], state_filter=state_filter
         )
-        logger.info("get_event_context event_id=%s state=%s", event_id, state)
 
         state_events = list(state[event_id_to_get_state_from].values())
         if event_filter:
diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py
index c8240a956e..ed95189b6d 100644
--- a/synapse/rest/client/room.py
+++ b/synapse/rest/client/room.py
@@ -557,9 +557,6 @@ class RoomMessageListRestServlet(RestServlet):
     async def on_GET(
         self, request: SynapseRequest, room_id: str
     ) -> Tuple[int, JsonDict]:
-        logger.info("room /messages =====================================================")
-        logger.info("====================================================================")
-
         requester = await self.auth.get_user_by_req(request, allow_guest=True)
         pagination_config = await PaginationConfig.from_request(
             self.store, request, default_limit=10
@@ -698,7 +695,6 @@ class RoomEventContextServlet(RestServlet):
         results = await self.room_context_handler.get_event_context(
             requester, room_id, event_id, limit, event_filter
         )
-        logger.info("get /context event_id=%s results=%s", event_id, results)
 
         if not results:
             raise SynapseError(404, "Event not found.", errcode=Codes.NOT_FOUND)
diff --git a/synapse/rest/client/room_batch.py b/synapse/rest/client/room_batch.py
index 789fe75acc..1dffcc3147 100644
--- a/synapse/rest/client/room_batch.py
+++ b/synapse/rest/client/room_batch.py
@@ -176,8 +176,6 @@ class RoomBatchSendEventRestServlet(RestServlet):
     async def on_POST(
         self, request: SynapseRequest, room_id: str
     ) -> Tuple[int, JsonDict]:
-        logger.info("room batch send =====================================================")
-        logger.info("=====================================================================")
         requester = await self.auth.get_user_by_req(request, allow_guest=False)
 
         if not requester.app_service:
@@ -307,7 +305,6 @@ class RoomBatchSendEventRestServlet(RestServlet):
 
             # Verify the batch_id_from_query corresponds to an actual insertion event
             # and have the batch connected.
-            logger.info("get_insertion_event_by_batch_id room_id=%room_id batch_id_from_query=%s", room_id, batch_id_from_query)
             corresponding_insertion_event_id = (
                 await self.store.get_insertion_event_by_batch_id(
                     room_id, batch_id_from_query
diff --git a/synapse/storage/databases/main/events.py b/synapse/storage/databases/main/events.py
index b544230289..19f55c19c5 100644
--- a/synapse/storage/databases/main/events.py
+++ b/synapse/storage/databases/main/events.py
@@ -1753,10 +1753,6 @@ class PersistEventsStore:
             # Not a insertion event
             return
 
-        logger.info(
-            "_handle_insertion_event at the start %s", event
-        )
-
         # Skip processing an insertion event if the room version doesn't
         # support it or the event is not from the room creator.
         room_version = self.store.get_room_version_txn(txn, event.room_id)
@@ -1767,17 +1763,9 @@ class PersistEventsStore:
             retcol="creator",
             allow_none=True,
         )
-        logger.info(
-            "_handle_insertion_event at the start room_version.msc2716_historical=%s self.hs.config.experimental.msc2716_enabled=%s event.sender=%s room_creator=%s",
-            room_version.msc2716_historical,
-            self.hs.config.experimental.msc2716_enabled,
-            event.sender,
-            room_creator
-        )
-        if (
-            not room_version.msc2716_historical
-            and (not self.hs.config.experimental.msc2716_enabled
-            or event.sender != room_creator)
+        if not room_version.msc2716_historical and (
+            not self.hs.config.experimental.msc2716_enabled
+            or event.sender != room_creator
         ):
             return
 
@@ -1786,7 +1774,7 @@ class PersistEventsStore:
             # Invalid insertion event without next batch ID
             return
 
-        logger.info(
+        logger.debug(
             "_handle_insertion_event (next_batch_id=%s) %s", next_batch_id, event
         )
 
@@ -1836,10 +1824,9 @@ class PersistEventsStore:
             retcol="creator",
             allow_none=True,
         )
-        if (
-            not room_version.msc2716_historical
-            and (not self.hs.config.experimental.msc2716_enabled
-            or event.sender != room_creator)
+        if not room_version.msc2716_historical and (
+            not self.hs.config.experimental.msc2716_enabled
+            or event.sender != room_creator
         ):
             return
 
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index aea3abbb1b..5e86befde4 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -491,6 +491,7 @@ class StateGroupStorage:
             [ev_id for sd in group_to_state.values() for ev_id in sd.values()],
             get_prev_content=False,
         )
+
         event_to_state = {
             event_id: {
                 k: state_event_map[v]
@@ -499,14 +500,6 @@ class StateGroupStorage:
             }
             for event_id, group in event_to_groups.items()
         }
-        # logger.info(
-        #     "event_to_groups event_ids=%s event_to_groups=%s group_to_state=%s state_event_map=%s event_to_state=%s",
-        #     event_ids,
-        #     event_to_groups,
-        #     group_to_state,
-        #     state_event_map,
-        #     event_to_state
-        # )
 
         return {event: event_to_state[event] for event in event_ids}
 
@@ -536,14 +529,6 @@ class StateGroupStorage:
             for event_id, group in event_to_groups.items()
         }
 
-        logger.info(
-            "get_state_ids_for_events event_ids=%s event_to_groups=%s group_to_state=%s event_to_state=%s",
-            event_ids,
-            event_to_groups,
-            group_to_state,
-            event_to_state
-        )
-
         return {event: event_to_state[event] for event in event_ids}
 
     async def get_state_for_event(