Fix stuck timeline pagination because of too many membership events
Requires https://github.com/matrix-org/matrix-rust-sdk/pull/1314
This commit is contained in:
@@ -55,7 +55,7 @@ struct MockRoomProxy: RoomProxyProtocol {
|
||||
.failure(.failedAddingTimelineListener)
|
||||
}
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> {
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError> {
|
||||
.failure(.failedPaginatingBackwards)
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
// }
|
||||
}
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> {
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError> {
|
||||
guard backPaginationOutcome?.moreMessages != false else {
|
||||
return .failure(.noMoreMessagesToBackPaginate)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
try self.room.paginateBackwards(limit: UInt16(count))
|
||||
}
|
||||
update(backPaginationOutcome: outcome)
|
||||
return .success(())
|
||||
return .success(UInt(outcome.numUpdates))
|
||||
} catch {
|
||||
return .failure(.failedPaginatingBackwards)
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError>
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError>
|
||||
func paginateBackwards(count: UInt) async -> Result<UInt, RoomProxyError>
|
||||
|
||||
func sendMessage(_ message: String, inReplyToEventId: String?) async -> Result<Void, RoomProxyError>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
// MARK: - Private
|
||||
|
||||
fileprivate func updateRoomsWithDiffs(_ diffs: [SlidingSyncViewRoomsListDiff]) {
|
||||
MXLog.info("Received diffs")
|
||||
MXLog.info("Received \(diffs.count) diffs")
|
||||
|
||||
rooms = diffs
|
||||
.reduce(rooms) { currentItems, diff in
|
||||
|
||||
@@ -72,8 +72,12 @@ class RoomTimelineProvider: RoomTimelineProviderProtocol {
|
||||
|
||||
MXLog.info("Started back pagination request")
|
||||
switch await roomProxy.paginateBackwards(count: count) {
|
||||
case .success:
|
||||
MXLog.info("Finished back pagination request")
|
||||
case .success(let numUpdates):
|
||||
MXLog.info("Finished back pagination request. Got \(numUpdates) updates")
|
||||
|
||||
if numUpdates == 0 {
|
||||
backPaginationPublisher.send(false)
|
||||
}
|
||||
return .success(())
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed back pagination request with error: \(error)")
|
||||
|
||||
1
changelog.d/394.bugfix
Normal file
1
changelog.d/394.bugfix
Normal file
@@ -0,0 +1 @@
|
||||
Fix stuck timeline pagination because of too many membership events
|
||||
Reference in New Issue
Block a user