fix merge

This commit is contained in:
dklimpel 2021-11-09 20:05:07 +01:00
parent fb2019d53f
commit 3b3cf2aa88
2 changed files with 18 additions and 9 deletions

View file

@ -22,6 +22,7 @@ from twisted.python.failure import Failure
from synapse.api.constants import EventTypes, Membership from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import SynapseError from synapse.api.errors import SynapseError
from synapse.api.filtering import Filter 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.metrics.background_process_metrics import run_as_background_process
from synapse.storage.state import StateFilter from synapse.storage.state import StateFilter
from synapse.streams.config import PaginationConfig from synapse.streams.config import PaginationConfig
@ -65,7 +66,12 @@ class PurgeStatus:
error: str = "" error: str = ""
# Saves the result of an action to give it back to REST API # 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: def asdict(self) -> JsonDict:
ret = { ret = {
@ -557,14 +563,7 @@ class PaginationHandler:
If set to `true`, the room will be purged from database If set to `true`, the room will be purged from database
also if it fails to remove some users from room. also if it fails to remove some users from room.
Saves a dict containing the following keys in `PurgeStatus`: Saves a `RoomShutdownHandler.ShutdownRoomResponse` 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.
""" """
self._purges_in_progress_by_room.add(room_id) self._purges_in_progress_by_room.add(room_id)

View file

@ -1279,6 +1279,16 @@ class RoomEventSource(EventSource[RoomStreamToken, EventBase]):
class ShutdownRoomResponse(TypedDict): 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] kicked_users: List[str]
failed_to_kick_users: List[str] failed_to_kick_users: List[str]
local_aliases: List[str] local_aliases: List[str]