mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
This commit is contained in:
@@ -87,6 +87,8 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
return updatedItems
|
||||
}
|
||||
|
||||
detectDuplicatesInRoomList(rooms)
|
||||
|
||||
MXLog.info("Finished applying \(diffs.count) diffs")
|
||||
}
|
||||
|
||||
@@ -185,6 +187,25 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
|
||||
return CollectionDifference(changes)
|
||||
}
|
||||
|
||||
private func detectDuplicatesInRoomList(_ rooms: [RoomSummary]) {
|
||||
let filteredRooms = rooms.filter {
|
||||
switch $0 {
|
||||
case .empty:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
let groupedRooms = Dictionary(grouping: filteredRooms, by: \.id)
|
||||
|
||||
let duplicates = groupedRooms.filter { $1.count > 1 }
|
||||
|
||||
if duplicates.count > 0 {
|
||||
MXLog.error("Found duplicated room room list items: \(duplicates)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SlidingSyncViewRoomsListDiff {
|
||||
|
||||
Reference in New Issue
Block a user