better log message for auth chain room id mismatch

The previous "Evil event in db" message does not indicate what's going
on, and does not help identify *which* events are causing the problem.
This commit is contained in:
Benjamin Lee 2024-06-17 20:18:30 -07:00
parent b11cbb6991
commit 3ca6d7776b
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4

View file

@ -154,9 +154,10 @@ impl Service {
match services().rooms.timeline.get_pdu(&event_id) { match services().rooms.timeline.get_pdu(&event_id) {
Ok(Some(pdu)) => { Ok(Some(pdu)) => {
if pdu.room_id != room_id { if pdu.room_id != room_id {
warn!(bad_room_id = %pdu.room_id, "Event referenced in auth chain has incorrect room id");
return Err(Error::BadRequest( return Err(Error::BadRequest(
ErrorKind::forbidden(), ErrorKind::forbidden(),
"Evil event in db", "Event has incorrect room id",
)); ));
} }
for auth_event in &pdu.auth_events { for auth_event in &pdu.auth_events {