The spec defines i = ∞ for events with no mainline ancestor, so under "x < y if x.position > y.position" they sort before all chain-rooted events. With 0-based real positions, 0 collided with the sentinel and the two classes tied on the primary sort key. The mainline map is now keyed on `NonZero<usize>` and the sentinel becomes `None`.
7.8 KiB
7.8 KiB
Changelog
Unreleased
Bug fixes:
- Fix
m.room.memberauthorization for events withknockmembership in room versions 7-9. The check that the join rule supports knocking was unreachable, so any non-knock join rule was accepted. - Fix
mainline_sortcollision between events with no power-levels ancestor in their auth chain and events whose deepest power-levels ancestor is the oldest in the mainline. Mainline positions are nowOption<NonZero<usize>>, withNonerepresenting the no-mainline-ancestor case and sorting before all chain-rooted events.
0.16.0
Breaking:
resolve()andreverse_topological_power_sort()now takeEventIdSet<E::Id>s rather thanHashSet<E::Id>. This is an opaque set type that will allow to optimize the backing implementation in the future.reverse_topological_power_sort()now takes anEventIdMap<E::Id, _>rather than aHashMap<E::Id, _>. This is an opaque map type that will allow to optimize the backing implementation in the future.
0.15.0
Breaking:
- The
criterioncargo feature used for benchmarks was renamed to__criterion, to make it obvious that it is private.
0.14.0
Breaking:
auth_checkreturns aResult<(), String>instead of aResult<bool, Error>. A successful check now returnsOk(())instead ofOk(true)and all failures return anErr(_)with a description of the check that failed.- The variants of
Errorwere changed:Unsupportedwas removed since we always take anAuthorizationRulesinstead of aRoomVersionId.NotFoundholds anOwnedEventId.- The cases that were triggering an
InvalidPduerror now trigger aMissingStateKeyerror. - The cases that were triggering a
SerdeJsonor aCustomerror are either ignored when coming from theauth_check()(see corresponding bug fix) or return anAuthEventerror.
auth_types_for_eventtakes anAuthorizationRules, to check if restricted join rules are allowed before looking for thejoin_authorised_via_users_serverfield inm.room.member.resolvetakes anAuthorizationRulesinstead of aRoomVersionId. This allows server implementations to support custom room versions. They only need to provide anAuthorizationRulesfor their customRoomVersionId.RoomVersionwas moved to ruma-common and renamedRoomVersionRules, along with other changes. Check the changelog of ruma-common for more details.- The
event_authmodule is no longer public. Everything public inside of it is already exposed at the root of the crate. auth_checkwas split into 2 functions:check_state_independent_auth_rulesandcheck_state_dependent_auth_rules. The former should be called once when the incoming event is received, while the latter should be called for every state that should be checked.lexicographical_topological_sort()was renamed toreverse_topological_power_sort(), to match the name of the algorithm defined in the Matrix spec.- Return
UserPowerLevelin place ofIntforreverse_topological_power_sort. - Rename
RoomCreateEvent::creatortoRoomCreateEvent::creators, and have it return a set of user IDs instead of only ever returning one. Event::room_id()must now return anOption<&RoomId>, sincem.room.createevents don't have aroom_idfield in room version 12.resolvenow additionally takes the following parameters:state_res_rules: used to specify tweaks to apply to the state resolution algorithm.fetch_conflicted_state_subgraph: a function which calculates which event IDs form the conflicted state subgraph of the given conflicted events.
Bug fixes:
- Don't propagate errors from
auth_check()inresolve(). If an event fails the authorization check, it should just be ignored for the resolved state. - Don't error on deserialization of malformed fields that are not checked in the
authorization rules for
m.room.create,m.room.member,m.room.power_levels,m.room.join_rulesandm.room.third_party_inviteevents. - Fix
auth_checkform.room.memberwith aninvitemembership and athird_party_invite. Thesignedobject in the content is now verified against the public keys in the matchingm.room.third_party_inviteevent. check_state_independent_auth_rulesnow performs the authorization rules checks onauth_events.
Improvements:
- New types with lazy deserialization that can be used by servers over the
stricter types from ruma-events to access the fields of an event when received
over federation, to avoid erroring on malformed fields that are not checked by
the authorization rules:
RoomCreateEventform.room.createeventsRoomMemberEventform.room.membereventsRoomPowerLevelsEventform.room.power_levelseventsRoomJoinRulesEventform.room.join_ruleseventsRoomThirdPartyInviteEventform.room.third_party_inviteevents
- Add
check_pdu_format()to check the event format and size limits of a PDU according to the Matrix specification.
0.13.0
Bug fixes:
- Fix tiebreaking logic in state resolution.
Improvements:
- The
unstable-exhaustive-typescargo feature was replaced by theruma_unstable_exhaustive_typescompile-timecfgsetting. Like allcfgsettings, it can be enabled at compile-time with theRUSTFLAGSenvironment variable, or inside.cargo/config.toml. It can also be enabled by setting theRUMA_UNSTABLE_EXHAUSTIVE_TYPESenvironment variable.
0.12.0
Upgrade ruma-events to 0.29.0.
0.11.0
Breaking changes:
- Upgrade dependencies
Bug fixes:
- Disallow
invite->knockmembership transition. The spec was determined to be right about rejecting it in the first place: https://github.com/matrix-org/matrix-spec/pull/1717 - Perform extra redaction checks on room versions 1 and 2, rather than for version 3 and onwards
0.10.0
Improvements:
- Add
RoomVersion::V11according to MSC3820 / Matrix 1.8
0.9.1
No changes for this version
0.9.0
Bug fixes:
- Fix third party invite event authorization. The event was not allowed even after passing all the required checks, so it could fail further down the algorithm.
- Allow
invite->knockmembership transition- The spec was determined to be wrong about rejecting it: https://github.com/matrix-org/matrix-spec/pull/1175
0.8.0
Bug fixes:
- Change default
invitepower level to0- The spec was determined to be wrong about the default: https://github.com/matrix-org/matrix-spec/pull/1021
Improvements:
- Add
m.federatetoauth_check: https://github.com/matrix-org/matrix-spec/pull/1103 - Add
RoomVersion::V10(MSC3604) - Deserialize stringified integers for power levels without the
compatfeature- Removes the
compatfeature
- Removes the
0.7.0
Breaking changes:
auth_checkdoes not requireprev_eventparameter. It was only required on some specific cases. Previous event is now calculated on demand only when it's required.
0.6.0
Breaking changes:
- Upgrade dependencies
0.5.0
Breaking changes:
- Remove some trait methods from
Event - Update
Event::contentsignature to return&RawJsonValueinstead of&JsonValue - The
key_fninlexicographical_topological_sorthas removed the event ID from its return type and changed to expect just the power level, not the negated power level
0.4.1
Improvements:
- Improve performance of
StateResolution::separate
0.4.0
Breaking changes:
- Change the way events are supplied
0.3.0
Breaking changes:
- state_res::resolve auth_events type has been slightly changed and renamed to auth_chain_sets
- state_res::resolve structs were changed from BTreeMap/Set to HashMap/Set
- Upgrade dependencies
0.2.0
Breaking changes:
- Replace
VecbyBTreeSetin parts of the API - Replace
event_mapargument with a closure to fetch events on demand
0.1.0
Initial release