mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-11 13:59:13 +00:00
Remove room duplicate detection after each diff processing
- room list sorting and handling will be moved to the SDK instead of relying on SS diffs - we will reintroduce this but on the rust side
This commit is contained in:
parent
a0a19fa75b
commit
0c2445e01a
@ -153,8 +153,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
}
|
||||
rooms = updatedItems
|
||||
|
||||
detectDuplicatesInRoomList(rooms)
|
||||
|
||||
MXLog.verbose("\(name): Finished applying \(diffs.count) diffs, new room list \(rooms.compactMap { $0.id ?? "Empty" })")
|
||||
|
||||
ServiceLocator.shared.analytics.signpost.endFirstRooms()
|
||||
@ -315,25 +313,6 @@ 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("\(name): Found duplicated room room list items: \(duplicates)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension RoomSummaryProviderState {
|
||||
|
Loading…
x
Reference in New Issue
Block a user