log error for auth_chain corruption immediately

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-24 11:24:37 +00:00
parent e175b7d28d
commit 60cc07134f

View file

@ -167,10 +167,12 @@ impl Service {
Err(e) => debug_error!(?event_id, ?e, "Could not find pdu mentioned in auth events"), Err(e) => debug_error!(?event_id, ?e, "Could not find pdu mentioned in auth events"),
Ok(pdu) => { Ok(pdu) => {
if pdu.room_id != room_id { if pdu.room_id != room_id {
return Err!(Request(Forbidden( return Err!(Request(Forbidden(error!(
"auth event {event_id:?} for incorrect room {} which is not {room_id}", ?event_id,
pdu.room_id, ?room_id,
))); wrong_room_id = ?pdu.room_id,
"auth event for incorrect room"
))));
} }
for auth_event in &pdu.auth_events { for auth_event in &pdu.auth_events {