fix: Fix pagination tokens being corrupted for backfilled PDUs

This commit is contained in:
Ginger 2025-09-04 10:33:43 -04:00 committed by nex
commit 16f4efa708
6 changed files with 18 additions and 36 deletions

View file

@ -18,7 +18,7 @@ use ruma::{
events::{TimelineEventType, relation::RelationType},
};
use super::utils::{count_to_token, parse_pagination_token as parse_token};
use super::utils::{count_to_pagination_token, pagination_token_to_count as parse_token};
use crate::Ruma;
/// # `GET /_matrix/client/r0/rooms/{roomId}/relations/{eventId}/{relType}/{eventType}`
@ -193,7 +193,7 @@ async fn paginate_relations_with_filter(
| Direction::Forward => events.last(),
| Direction::Backward => events.first(),
}
.map(|(count, _)| count_to_token(*count))
.map(|(count, _)| count_to_pagination_token(*count))
} else {
None
};