diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 588c1f28..9f0d44f0 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1196,10 +1196,11 @@ # #typing_client_timeout_max_s = 45 -# The maximum number of events to send at once for non-limited legacy syncs. -# Has no effect on sliding sync. This parameter also affects how many messages from each room -# are sent to the client on initial syncs, and larger values will make initial syncs slower. -# The default of 10 is reasonable for most use cases. +# The maximum number of events to send at once for non-limited legacy +# syncs. Has no effect on sliding sync. This parameter also affects how +# many messages from each room are sent to the client on initial syncs; +# larger values will make initial syncs slower. The default of 10 is +# reasonable for most use cases. # #incremental_sync_max_timeline_size = 10 diff --git a/src/api/client/sync/v3/left.rs b/src/api/client/sync/v3/left.rs index 6ee754d3..ab5f36d9 100644 --- a/src/api/client/sync/v3/left.rs +++ b/src/api/client/sync/v3/left.rs @@ -73,7 +73,11 @@ pub(super) async fn load_left_room( } if let Some(ref leave_pdu) = leave_pdu { - debug_assert_eq!(leave_pdu.kind, TimelineEventType::RoomMember); + debug_assert_eq!( + leave_pdu.kind, + TimelineEventType::RoomMember, + "leave PDU should be m.room.member" + ); } let does_not_exist = services.rooms.metadata.exists(room_id).eq(&false).await; @@ -93,7 +97,11 @@ pub(super) async fn load_left_room( // the user left if they're allowed to see it. let leave_state_key = sender_user; - debug_assert_eq!(Some(leave_state_key.as_str()), leave_pdu.state_key()); + debug_assert_eq!( + Some(leave_state_key.as_str()), + leave_pdu.state_key(), + "leave PDU should be for the user requesting the sync" + ); let leave_shortstatehash = services .rooms diff --git a/src/api/client/sync/v5.rs b/src/api/client/sync/v5.rs index 24180b35..f38083db 100644 --- a/src/api/client/sync/v5.rs +++ b/src/api/client/sync/v5.rs @@ -708,7 +708,7 @@ async fn collect_typing_events( } let mut typing_response = sync_events::v5::response::Typing::default(); - for (room_id, (required_state_request, timeline_limit, roomsince)) in todo_rooms { + for (room_id, (_, _, roomsince)) in todo_rooms { if services.rooms.typing.last_typing_update(room_id).await? <= *roomsince { continue; } diff --git a/src/api/server/invite.rs b/src/api/server/invite.rs index 1c12aa8d..6d9b08ea 100644 --- a/src/api/server/invite.rs +++ b/src/api/server/invite.rs @@ -135,7 +135,7 @@ pub(crate) async fn create_invite_route( .mark_as_invited( &recipient_user, &body.room_id, - &sender_user, + sender_user, Some(invite_state), body.via.clone(), ) diff --git a/src/service/rooms/short/mod.rs b/src/service/rooms/short/mod.rs index 6eafc8ee..7c21e826 100644 --- a/src/service/rooms/short/mod.rs +++ b/src/service/rooms/short/mod.rs @@ -283,7 +283,6 @@ where ) .ready_filter_map(|state_event| match state_event { | (Ok(state_key), Ok(event_id)) => Some(Ok((state_key, event_id))), - | (Err(e), _) => Some(Err(e)), - | (_, Err(e)) => Some(Err(e)), + | (Err(e), _) | (_, Err(e)) => Some(Err(e)), }) } diff --git a/src/service/rooms/timeline/append.rs b/src/service/rooms/timeline/append.rs index 8a2b4782..c141577d 100644 --- a/src/service/rooms/timeline/append.rs +++ b/src/service/rooms/timeline/append.rs @@ -326,7 +326,7 @@ where // knock event for auth self.services .state_cache - .update_membership(room_id, target_user_id, &pdu, true) + .update_membership(room_id, target_user_id, pdu, true) .await?; } },