fix: Don't fail open when a PDU doesn't have a short state hash

This commit is contained in:
timedout
2026-02-06 18:09:09 +00:00
parent 6763952ce4
commit 0ea0d09b97
2 changed files with 11 additions and 15 deletions
@@ -1,4 +1,4 @@
use conduwuit::{implement, utils::stream::ReadyExt};
use conduwuit::{implement, utils::stream::ReadyExt, warn};
use futures::StreamExt;
use ruma::{
EventId, RoomId, ServerName,
@@ -19,7 +19,12 @@ pub async fn server_can_see_event(
event_id: &EventId,
) -> bool {
let Ok(shortstatehash) = self.pdu_shortstatehash(event_id).await else {
return true;
warn!(
"Unable to visibility check event {} in room {} for server {}: shortstatehash not \
found",
event_id, room_id, origin
);
return false;
};
let history_visibility = self