matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.12k forks source link

Fix upgrading a room without `events` field in power levels #16725

Closed DMRobertson closed 11 months ago

DMRobertson commented 11 months ago

Fixes #16715, per https://github.com/matrix-org/synapse/issues/16715#issuecomment-1838349379. Looks to have been introduced in https://github.com/matrix-org/synapse/pull/6237.

C.f. https://spec.matrix.org/v1.9/client-server-api/#mroompower_levels

Sanity checking Erik's reasoning, the point of this code is to ensure that the upgrader is able to set any state in the new room. If event_power_levels is empty then there are no extra requirements to impose, so I think a fallback of 0 is sensible.

DMRobertson commented 11 months ago

Tests are very unhappy