summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-04-19 16:49:45 +0100
committerGitHub <noreply@github.com>2022-04-19 16:49:45 +0100
commitc1482a352acd35055db93f5d0b5de1bec8974fa0 (patch)
treee9f351251f715ead07d69c7ed1e6f80accc4c5c4 /synapse/storage
parentFix `/room/.../event/...` to return the *original* event after any edits (#12... (diff)
downloadsynapse-c1482a352acd35055db93f5d0b5de1bec8974fa0.tar.xz
Fix returned count of delete extremities admin API (#12496)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/events_forward_extremities.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/events_forward_extremities.py b/synapse/storage/databases/main/events_forward_extremities.py
index 68901b4335..f851bff604 100644
--- a/synapse/storage/databases/main/events_forward_extremities.py
+++ b/synapse/storage/databases/main/events_forward_extremities.py
@@ -66,13 +66,15 @@ class EventForwardExtremitiesStore(
             """
 
             txn.execute(sql, (event_id, room_id))
+
+            deleted_count = txn.rowcount
             logger.info(
                 "Deleted %s extra forward extremities for room %s",
-                txn.rowcount,
+                deleted_count,
                 room_id,
             )
 
-            if txn.rowcount > 0:
+            if deleted_count > 0:
                 # Invalidate the cache
                 self._invalidate_cache_and_stream(
                     txn,
@@ -80,7 +82,7 @@ class EventForwardExtremitiesStore(
                     (room_id,),
                 )
 
-            return txn.rowcount
+            return deleted_count
 
         return await self.db_pool.runInteraction(
             "delete_forward_extremities_for_room",