From c82e1b8ec30c5fc511a40223031fe83e8a48dee9 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Fri, 5 Dec 2025 16:19:26 +0100 Subject: [PATCH] fixup! feat(room): make load_event_with_relations also load relations when falling back to the network Change limit to 256 Signed-off-by: Johannes Marbach --- .../src/timeline/pinned_events_loader.rs | 2 +- .../integration/timeline/pinned_event.rs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/matrix-sdk-ui/src/timeline/pinned_events_loader.rs b/crates/matrix-sdk-ui/src/timeline/pinned_events_loader.rs index f5256e3d8..117c4ece4 100644 --- a/crates/matrix-sdk-ui/src/timeline/pinned_events_loader.rs +++ b/crates/matrix-sdk-ui/src/timeline/pinned_events_loader.rs @@ -193,7 +193,7 @@ impl PinnedEventsRoom for Room { let mut opts = RelationsOptions { include_relations: IncludeRelations::AllRelations, recurse: true, - limit: Some(uint!(1000)), + limit: Some(uint!(256)), ..Default::default() }; diff --git a/crates/matrix-sdk-ui/tests/integration/timeline/pinned_event.rs b/crates/matrix-sdk-ui/tests/integration/timeline/pinned_event.rs index 7cf2691c5..d07a478b6 100644 --- a/crates/matrix-sdk-ui/tests/integration/timeline/pinned_event.rs +++ b/crates/matrix-sdk-ui/tests/integration/timeline/pinned_event.rs @@ -66,7 +66,7 @@ async fn test_new_pinned_events_are_not_added_on_sync() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -137,7 +137,7 @@ async fn test_pinned_event_with_reaction() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(vec![reaction])) .mock_once() .mount() @@ -200,7 +200,7 @@ async fn test_pinned_event_with_paginated_reactions() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(vec![reaction_1]).next_batch(token)) .mock_once() .mount() @@ -208,7 +208,7 @@ async fn test_pinned_event_with_paginated_reactions() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .match_from(token) .ok(RoomRelationsResponseTemplate::default().events(vec![reaction_2])) .mock_once() @@ -275,7 +275,7 @@ async fn test_new_pinned_event_ids_reload_the_timeline() { server .mock_room_relations() .match_target_event(event_id_1.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -283,7 +283,7 @@ async fn test_new_pinned_event_ids_reload_the_timeline() { server .mock_room_relations() .match_target_event(event_id_2.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -406,7 +406,7 @@ async fn test_cached_events_are_kept_for_different_room_instances() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -608,7 +608,7 @@ async fn test_pinned_timeline_with_pinned_utd_on_sync_contains_it() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -645,7 +645,7 @@ async fn test_edited_events_are_reflected_in_sync() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount() @@ -728,7 +728,7 @@ async fn test_redacted_events_are_reflected_in_sync() { server .mock_room_relations() .match_target_event(event_id.to_owned()) - .match_limit(1000) + .match_limit(256) .ok(RoomRelationsResponseTemplate::default().events(Vec::>::new())) .mock_once() .mount()