Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Properly check for frozendicts. #14864

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14864.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse 1.64.0 when using room version 10 with frozen events enabled.
3 changes: 2 additions & 1 deletion synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import collections.abc
import logging
import typing
from typing import (
Expand Down Expand Up @@ -877,7 +878,7 @@ def _check_power_levels(
if not isinstance(v, int):
raise SynapseError(400, f"{v!r} must be an integer.")
if k in {"events", "notifications", "users"}:
if not isinstance(v, dict) or not all(
if not isinstance(v, collections.abc.Mapping) or not all(
isinstance(v, int) for v in v.values()
):
raise SynapseError(
Expand Down