Skip to content

Commit 8a6cc7b

Browse files
committed
refactor(sdk): Only log the power levels computing error for joined rooms
1 parent 61258e8 commit 8a6cc7b

File tree

1 file changed

+5
-1
lines changed
  • crates/matrix-sdk/src/room

1 file changed

+5
-1
lines changed

crates/matrix-sdk/src/room/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,11 @@ impl Room {
30093009
let power_levels = match self.power_levels().await {
30103010
Ok(power_levels) => Some(power_levels.into()),
30113011
Err(error) => {
3012-
error!("Could not compute power levels for push conditions: {error}");
3012+
if matches!(room_info.state(), RoomState::Joined) {
3013+
// It's normal to not have the power levels in a non-joined room, so don't log
3014+
// the error if the room is not joined
3015+
error!("Could not compute power levels for push conditions: {error}");
3016+
}
30133017
None
30143018
}
30153019
};

0 commit comments

Comments
 (0)