fix: add detailed logging for unlock process to improve debugging and performance tracking
This commit is contained in:
@@ -106,17 +106,25 @@ class MessageRepository private constructor(private val context: Context) {
|
||||
* Инициализация с текущим аккаунтом
|
||||
*/
|
||||
fun initialize(publicKey: String, privateKey: String) {
|
||||
val start = System.currentTimeMillis()
|
||||
android.util.Log.d("MessageRepository", "🔧 initialize started for ${publicKey.take(8)}...")
|
||||
|
||||
// 🔥 Очищаем кэш запрошенных user info при смене аккаунта
|
||||
if (currentAccount != publicKey) {
|
||||
requestedUserInfoKeys.clear()
|
||||
android.util.Log.d("MessageRepository", "🔧 Cleared user info cache (account changed)")
|
||||
}
|
||||
|
||||
currentAccount = publicKey
|
||||
currentPrivateKey = privateKey
|
||||
|
||||
android.util.Log.d("MessageRepository", "🔧 initialize completed in ${System.currentTimeMillis() - start}ms (launching dialogs flow in background)")
|
||||
|
||||
// Загрузка диалогов
|
||||
scope.launch {
|
||||
android.util.Log.d("MessageRepository", "📂 Starting dialogs flow collection...")
|
||||
dialogDao.getDialogsFlow(publicKey).collect { entities ->
|
||||
android.util.Log.d("MessageRepository", "📂 Got ${entities.size} dialogs from DB")
|
||||
_dialogs.value = entities.map { it.toDialog() }
|
||||
|
||||
// 🔥 Запрашиваем информацию о пользователях, у которых нет имени
|
||||
|
||||
Reference in New Issue
Block a user