Add logs to detect duplicates in the room list (#5364)

* Add logs to detect duplicates in the room list

* Add comments and helper class about the caching results logging
This commit is contained in:
Jorge Martin Espinosa 2025-09-19 16:24:06 +02:00 committed by GitHub
parent 0b4b63a96b
commit 5c893e7de1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 1 deletions

View file

@ -33,6 +33,12 @@ class RoomSummaryListProcessor(
updates.forEach { update ->
applyUpdate(update)
}
// TODO remove once https://github.com/element-hq/element-x-android/issues/5031 has been confirmed as fixed
val duplicates = groupingBy { it.roomId }.eachCount().filter { it.value > 1 }
if (duplicates.isNotEmpty()) {
Timber.e("Found duplicates in room summaries after a list update from the SDK: $duplicates. Updates: $updates")
}
}
}