Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix purge_room admin API (#6711)
Browse files Browse the repository at this point in the history
* commit '19a1aac48':
  Fix purge_room admin API (#6711)
  • Loading branch information
anoadragon453 committed Mar 23, 2020
2 parents 02931b9 + 19a1aac commit 888e203
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/6711.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `purge_room` admin API.
2 changes: 1 addition & 1 deletion synapse/storage/purge_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def purge_room(self, room_id: str):
"""

state_groups_to_delete = yield self.stores.main.purge_room(room_id)
yield self.stores.main.purge_room_state(room_id, state_groups_to_delete)
yield self.stores.state.purge_room_state(room_id, state_groups_to_delete)

@defer.inlineCallbacks
def purge_history(self, room_id, token, delete_local_events):
Expand Down
4 changes: 1 addition & 3 deletions tests/rest/admin/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def test_purge_room(self):
"local_invites",
"room_account_data",
"room_tags",
"state_groups",
# "state_groups", # Current impl leaves orphaned state groups around.
"state_groups_state",
):
count = self.get_success(
Expand All @@ -351,8 +351,6 @@ def test_purge_room(self):

self.assertEqual(count, 0, msg="Rows not purged in {}".format(table))

test_purge_room.skip = "Disabled because it's currently broken"


class QuarantineMediaTestCase(unittest.HomeserverTestCase):
"""Test /quarantine_media admin API.
Expand Down

0 comments on commit 888e203

Please sign in to comment.