fix: add detailed logging for unlock process to improve debugging and performance tracking

This commit is contained in:
k1ngsterr1
2026-02-05 01:56:18 +05:00
parent e307e8d35d
commit 4dc7c6e9bc
13 changed files with 640 additions and 169 deletions

View File

@@ -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() }
// 🔥 Запрашиваем информацию о пользователях, у которых нет имени