diff --git a/MatrixSDK/Data/EventTimeline/Room/MXRoomEventTimeline.m b/MatrixSDK/Data/EventTimeline/Room/MXRoomEventTimeline.m index bee993e215..0e33eeeb50 100644 --- a/MatrixSDK/Data/EventTimeline/Room/MXRoomEventTimeline.m +++ b/MatrixSDK/Data/EventTimeline/Room/MXRoomEventTimeline.m @@ -591,7 +591,8 @@ - (void)handleLazyLoadedStateEvents:(NSArray *)stateEvents - (void)handlePaginationResponse:(MXPaginationResponse*)paginatedResponse direction:(MXTimelineDirection)direction onComplete:(void (^)(void))onComplete { // Check pagination end - @see SPEC-319 ticket - if (paginatedResponse.chunk.count == 0 && [paginatedResponse.start isEqualToString:paginatedResponse.end]) + // End token might be ommited when end of the timeline is reached: https://github.com/matrix-org/synapse/pull/12903 + if (paginatedResponse.chunk.count == 0 && (paginatedResponse.end == nil || [paginatedResponse.start isEqualToString:paginatedResponse.end])) { // Store the fact we run out of items if (direction == MXTimelineDirectionBackwards) diff --git a/changelog.d/6347.bugfix b/changelog.d/6347.bugfix new file mode 100644 index 0000000000..2e0a791b21 --- /dev/null +++ b/changelog.d/6347.bugfix @@ -0,0 +1 @@ +Handle empty pagination end token on timeline end reached