Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed Nov 9, 2021
1 parent fb2019d commit 3b3cf2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 8 additions & 9 deletions synapse/handlers/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import SynapseError
from synapse.api.filtering import Filter
from synapse.handlers.room import ShutdownRoomResponse
from synapse.metrics.background_process_metrics import run_as_background_process
from synapse.storage.state import StateFilter
from synapse.streams.config import PaginationConfig
Expand Down Expand Up @@ -65,7 +66,12 @@ class PurgeStatus:
error: str = ""

# Saves the result of an action to give it back to REST API
shutdown_room: Dict = {}
shutdown_room: ShutdownRoomResponse = {
"kicked_users": [],
"failed_to_kick_users": [],
"local_aliases": [],
"new_room_id": None,
}

def asdict(self) -> JsonDict:
ret = {
Expand Down Expand Up @@ -557,14 +563,7 @@ async def _shutdown_and_purge_room(
If set to `true`, the room will be purged from database
also if it fails to remove some users from room.
Saves a dict containing the following keys in `PurgeStatus`:
kicked_users: An array of users (`user_id`) that were kicked.
failed_to_kick_users:
An array of users (`user_id`) that that were not kicked.
local_aliases:
An array of strings representing the local aliases that were
migrated from the old room to the new.
new_room_id: A string representing the room ID of the new room.
Saves a `RoomShutdownHandler.ShutdownRoomResponse` in `PurgeStatus`:
"""

self._purges_in_progress_by_room.add(room_id)
Expand Down
10 changes: 10 additions & 0 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,16 @@ def get_current_key_for_room(self, room_id: str) -> Awaitable[str]:


class ShutdownRoomResponse(TypedDict):
"""
kicked_users: An array of users (`user_id`) that were kicked.
failed_to_kick_users:
An array of users (`user_id`) that that were not kicked.
local_aliases:
An array of strings representing the local aliases that were
migrated from the old room to the new.
new_room_id: A string representing the room ID of the new room.
"""

kicked_users: List[str]
failed_to_kick_users: List[str]
local_aliases: List[str]
Expand Down

0 comments on commit 3b3cf2a

Please sign in to comment.