diff --git a/changelog.d/18066.bugfix b/changelog.d/18066.bugfix new file mode 100644 index 00000000000..c979822bf0b --- /dev/null +++ b/changelog.d/18066.bugfix @@ -0,0 +1 @@ +Fixed a bug that caused new space-visible rooms to be hidden from the space hierarchy when any server modules are loaded. \ No newline at end of file diff --git a/synapse/handlers/event_auth.py b/synapse/handlers/event_auth.py index c4dbf22408b..002eb4caf78 100644 --- a/synapse/handlers/event_auth.py +++ b/synapse/handlers/event_auth.py @@ -21,6 +21,8 @@ import logging from typing import TYPE_CHECKING, List, Mapping, Optional, Union +from immutabledict import immutabledict + from synapse import event_auth from synapse.api.constants import ( EventTypes, @@ -326,13 +328,13 @@ async def get_rooms_that_allow_join( # If allowed is of the wrong form, then only allow invited users. allow_list = join_rules_event.content.get("allow", []) - if not isinstance(allow_list, list): + if not isinstance(allow_list, (list, tuple)): return () # Pull out the other room IDs, invalid data gets filtered. result = [] for allow in allow_list: - if not isinstance(allow, dict): + if not isinstance(allow, (dict, immutabledict)): continue # If the type is unexpected, skip it. diff --git a/synapse/handlers/room_summary.py b/synapse/handlers/room_summary.py index 64f5bea014f..b2338727035 100644 --- a/synapse/handlers/room_summary.py +++ b/synapse/handlers/room_summary.py @@ -955,7 +955,7 @@ def as_json(self, for_client: bool = False) -> JsonDict: def _has_valid_via(e: EventBase) -> bool: via = e.content.get("via") - if not via or not isinstance(via, list): + if not via or not isinstance(via, (list, tuple)): return False for v in via: if not isinstance(v, str):