mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
remove comments about filtering buggy items
This commit is contained in:
parent
40f9aa6f60
commit
3efe3fb337
8 changed files with 10 additions and 14 deletions
|
|
@ -82,7 +82,7 @@ pub(crate) async fn get_context_route(
|
|||
.timeline
|
||||
.pdus_until(sender_user, &room_id, base_token)?
|
||||
.take(half_limit)
|
||||
.filter_map(Result::ok) // Remove buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
@ -118,7 +118,7 @@ pub(crate) async fn get_context_route(
|
|||
.timeline
|
||||
.pdus_after(sender_user, &room_id, base_token)?
|
||||
.take(half_limit)
|
||||
.filter_map(Result::ok) // Remove buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ pub(crate) async fn get_devices_route(
|
|||
let devices: Vec<device::Device> = services()
|
||||
.users
|
||||
.all_devices_metadata(sender_user)
|
||||
.filter_map(Result::ok) // Filter out buggy devices
|
||||
.filter_map(Result::ok)
|
||||
.collect();
|
||||
|
||||
Ok(get_devices::v3::Response { devices })
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ pub(crate) async fn get_public_rooms_filtered_helper(
|
|||
};
|
||||
Ok(chunk)
|
||||
})
|
||||
.filter_map(Result::<_>::ok) // Filter out buggy rooms
|
||||
.filter_map(Result::<_>::ok)
|
||||
.filter(|chunk| {
|
||||
if let Some(query) = filter
|
||||
.generic_search_term
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ pub(crate) async fn get_message_events_route(
|
|||
.timeline
|
||||
.pdus_after(sender_user, &body.room_id, from)?
|
||||
.take(limit)
|
||||
.filter_map(Result::ok) // Filter out buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
@ -206,7 +206,7 @@ pub(crate) async fn get_message_events_route(
|
|||
.timeline
|
||||
.pdus_until(sender_user, &body.room_id, from)?
|
||||
.take(limit)
|
||||
.filter_map(Result::ok) // Filter out buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ async fn load_joined_room(
|
|||
.rooms
|
||||
.timeline
|
||||
.all_pdus(sender_user, room_id)?
|
||||
.filter_map(Result::ok) // Ignore all broken pdus
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| pdu.kind == TimelineEventType::RoomMember)
|
||||
.map(|(_, pdu)| {
|
||||
let content: RoomMemberEventContent =
|
||||
|
|
@ -674,7 +674,6 @@ async fn load_joined_room(
|
|||
Ok(None)
|
||||
}
|
||||
})
|
||||
// Filter out buggy users
|
||||
.filter_map(Result::ok)
|
||||
// Filter for possible heroes
|
||||
.flatten()
|
||||
|
|
@ -1019,7 +1018,7 @@ async fn load_joined_room(
|
|||
.edus
|
||||
.read_receipt
|
||||
.readreceipts_since(room_id, since)
|
||||
.filter_map(Result::ok) // Filter out buggy events
|
||||
.filter_map(Result::ok)
|
||||
.map(|(_, _, v)| v)
|
||||
.collect();
|
||||
|
||||
|
|
@ -1104,7 +1103,6 @@ fn load_timeline(
|
|||
.timeline
|
||||
.pdus_until(sender_user, room_id, PduCount::MAX)?
|
||||
.filter_map(|r| {
|
||||
// Filter out buggy events
|
||||
if r.is_err() {
|
||||
error!("Bad pdu in pdus_since: {:?}", r);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ pub(crate) async fn search_users_route(
|
|||
let limit = body.limit.try_into().unwrap_or(usize::MAX);
|
||||
|
||||
let mut users = services().users.iter().filter_map(|user_id| {
|
||||
// Filter out buggy users (they should not exist, but you never know...)
|
||||
let user_id = user_id.ok()?;
|
||||
|
||||
let user = search_users::v3::User {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ impl service::rooms::timeline::Data for KeyValueDatabase {
|
|||
if let Some(last_count) = self
|
||||
.pdus_until(sender_user, room_id, PduCount::MAX)?
|
||||
.find_map(|r| {
|
||||
// Filter out buggy events
|
||||
if r.is_err() {
|
||||
error!("Bad pdu in pdus_since: {:?}", r);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ impl Service {
|
|||
})
|
||||
})
|
||||
.take(limit)
|
||||
.filter_map(Result::ok) // Filter out buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
@ -129,7 +129,7 @@ impl Service {
|
|||
})
|
||||
})
|
||||
.take(limit)
|
||||
.filter_map(Result::ok) // Filter out buggy events
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
.rooms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue