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

Commit

Permalink
Fix new power level event being deduplicated, thus not persisted
Browse files Browse the repository at this point in the history
Turns out we were overridding the content of the old power level event in the room, which
means that when it came time to persist the new power level event, the code compared the
content of the two and determined that the new state event was a duplicated, and thus it
wasn't persisted - so clients didn't see it down sync, and the new power levels were not
enforced after a server restart.

Copying the old power levels dict instead of using it directly solves the issue.
  • Loading branch information
anoadragon453 committed Oct 9, 2020
1 parent 0bb910b commit 763fa63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/third_party_rules/access_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ async def _freeze_room_if_last_admin_is_leaving(
) # type: EventBase
if not power_level_state_event:
return
power_level_content = power_level_state_event.content
power_level_content = power_level_state_event.content.copy()
if not isinstance(power_level_content, dict):
# The power level content has been set to something other than a dict...
# bail out.
Expand Down

0 comments on commit 763fa63

Please sign in to comment.