From b9c7ffe7c3a7e56e1045997d59e6cc5dfd836ee2 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 19 Feb 2025 11:46:58 +0100 Subject: [PATCH] doc(timeline): tweak comment in pagination to explain why it's correct --- crates/matrix-sdk-ui/src/timeline/pagination.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk-ui/src/timeline/pagination.rs b/crates/matrix-sdk-ui/src/timeline/pagination.rs index 273183650..414572f44 100644 --- a/crates/matrix-sdk-ui/src/timeline/pagination.rs +++ b/crates/matrix-sdk-ui/src/timeline/pagination.rs @@ -41,8 +41,11 @@ impl super::Timeline { ); } None => { - // TODO: returning `false` is not true everytime, we need a way to know if - // lazy-loading has reached the end of the timeline. + // We could adjust the skip count to a lower value, while passing the requested + // number of events. We *may* have reached the start of the timeline, but since + // we're fulfilling the caller's request, assume it's not the case and return + // false here. A subsequent call will go to the `Some()` arm of this match, and + // cause a call to the event cache's pagination. return Ok(false); } }