Fix purge_room admin API (#6711)

This commit is contained in:
Erik Johnston 2020-01-15 18:13:47 +00:00 committed by GitHub
parent edc244eec4
commit 19a1aac48c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

1
changelog.d/6711.bugfix Normal file
View File

@ -0,0 +1 @@
Fix `purge_room` admin API.

View File

@ -34,7 +34,7 @@ class PurgeEventsStorage(object):
""" """
state_groups_to_delete = yield self.stores.main.purge_room(room_id) 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 @defer.inlineCallbacks
def purge_history(self, room_id, token, delete_local_events): def purge_history(self, room_id, token, delete_local_events):

View File

@ -337,7 +337,7 @@ class PurgeRoomTestCase(unittest.HomeserverTestCase):
"local_invites", "local_invites",
"room_account_data", "room_account_data",
"room_tags", "room_tags",
"state_groups", # "state_groups", # Current impl leaves orphaned state groups around.
"state_groups_state", "state_groups_state",
): ):
count = self.get_success( count = self.get_success(
@ -351,8 +351,6 @@ class PurgeRoomTestCase(unittest.HomeserverTestCase):
self.assertEqual(count, 0, msg="Rows not purged in {}".format(table)) 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): class QuarantineMediaTestCase(unittest.HomeserverTestCase):
"""Test /quarantine_media admin API. """Test /quarantine_media admin API.