fix(pdu): Exempt m.room.create from auth_events check #1987
No reviewers
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1987
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "eleboucher/continuwuity:fix/pdu-room-create"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request exempts the m.room.create event from the PDU validation checks that mandate or forbid referencing a room creation event within auth_events.
During incoming federation invites, the homeserver validates the incoming stripped state events, which includes the room's m.room.create event. Because the creation event is the absolute genesis event of a room, its auth_events list is empty by definition.
Previously, the codebase applied the room version rules strictly to every single event. This created a logical paradox for the creation event, causing federation invites to fail with a 400 MINVALIDPARAM error: BadJson: PDU does not reference the room create event.
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
Good catch, I forgot this can happen
@ -50,0 +51,4 @@.get("state_key").and_then(CanonicalJsonValue::as_str);let is_create_event = event_type == Some("m.room.create") && state_key == Some("");typeis an expected field, so if it's None,BadJson("PDU is missing a type")should be returned, rather than allowing it to be nulltested with a friend facing the problem when join a space and after the fix we could invite him fine
28c06b9c372eba3897472eba3897477ecd2aa5e2@ -28,3 +28,3 @@```bash# Install prek using cargo-binstallcargo binstall prekcargo install prekOk so i know its merged already, but this seems wrong? Comment says "install with binstall", but this changes it to
install?idk I used
installmyself, idk whatbinstalleven isBinary install i guess
it's actually a deps https://github.com/cargo-bins/cargo-binstall my bad i didn't read above
will fix it there #1988