mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +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:
committed by
Stefan Ceriu
parent
a0a19fa75b
commit
0c2445e01a
@@ -153,8 +153,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
}
|
}
|
||||||
rooms = updatedItems
|
rooms = updatedItems
|
||||||
|
|
||||||
detectDuplicatesInRoomList(rooms)
|
|
||||||
|
|
||||||
MXLog.verbose("\(name): Finished applying \(diffs.count) diffs, new room list \(rooms.compactMap { $0.id ?? "Empty" })")
|
MXLog.verbose("\(name): Finished applying \(diffs.count) diffs, new room list \(rooms.compactMap { $0.id ?? "Empty" })")
|
||||||
|
|
||||||
ServiceLocator.shared.analytics.signpost.endFirstRooms()
|
ServiceLocator.shared.analytics.signpost.endFirstRooms()
|
||||||
@@ -315,25 +313,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
|
|
||||||
return CollectionDifference(changes)
|
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 {
|
extension RoomSummaryProviderState {
|
||||||
|
|||||||
Reference in New Issue
Block a user