You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This still might not handle all existing broken power level events though, since there might also be ones out there that use power levels > MAX_SAFE_INT.
This still might not handle all existing broken power level events though, since there might also be ones out there that use power levels > MAX_SAFE_INT.
That would not be broken, but neglectful. The defacto max power level is 100, we should not prevent anyone in their quest for absolute trouble and destruction by going higher than that.
No, that would be broken. Canonical JSON, which has to be able to represent any event, explicitly disallows larger values (and values smaller than MIN_SAFE_INT):
Numbers in the JSON must be integers in the range [-(2**53)+1, (2**53)-1].
Some older rooms have power level events with string power level rather than integers. To work around this:
Add an
unstable-synapse-quirks
feature to ruma-events and forward it from dependent cratesCreate a deserialization function in ruma-serde that accepts both integers and strings
Add
#[cfg_attr(feature = "unstable-synapse-quirks", serde(deserialize_with = "ruma_serde::deserialize_int_or_string"))]
to all power level fields
This still might not handle all existing broken power level events though, since there might also be ones out there that use power levels >
MAX_SAFE_INT
.CC @aledomu
The text was updated successfully, but these errors were encountered: