diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index c073b4e41ce3..3b3c79b36158 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -1427,7 +1427,7 @@ async def persist_and_notify_client_event( # Validate a newly added alias or newly added alt_aliases. original_alias = None - original_alt_aliases: List[str] = [] + original_alt_aliases: object = [] original_event_id = event.unsigned.get("replaces_state") if original_event_id: @@ -1455,9 +1455,7 @@ async def persist_and_notify_client_event( # If the old version of alt_aliases is of an unknown form, # completely replace it. if not isinstance(original_alt_aliases, (list, tuple)): - # type-ignore: although original_alt_aliases is defined as List[str], - # it may be set to `alt_aliases` from `original_event`, i.e. to any - # JSON value. Therefore this is not unreachable. + # TODO: check that the original_alt_aliases' entries are all strings original_alt_aliases = [] # type: ignore[unreachable] # Check that each alias is currently valid.