Add some log for further investigation

This commit is contained in:
Benoit Marty 2022-08-22 17:33:03 +02:00 committed by Benoit Marty
parent 13f7a9fc10
commit 9a0ea7bc2e
3 changed files with 26 additions and 8 deletions

View File

@ -207,6 +207,7 @@ internal class UpdateTrustWorker(context: Context, params: WorkerParameters, ses
private suspend fun updateTrustStep2(userList: List<String>, myCrossSigningInfo: MXCrossSigningInfo?) {
Timber.d("## CrossSigning - Updating shields for impacted rooms...")
awaitTransaction(sessionRealmConfiguration) { sessionRealm ->
Timber.d("## CrossSigning - Updating shields for impacted rooms - in transaction")
Realm.getInstance(cryptoRealmConfiguration).use { cryptoRealm ->
sessionRealm.where(RoomMemberSummaryEntity::class.java)
.`in`(RoomMemberSummaryEntityFields.USER_ID, userList.toTypedArray())
@ -239,6 +240,7 @@ internal class UpdateTrustWorker(context: Context, params: WorkerParameters, ses
}
}
}
Timber.d("## CrossSigning - Updating shields for impacted rooms - END")
}
private fun getCrossSigningInfo(cryptoRealm: Realm, userId: String): MXCrossSigningInfo? {

View File

@ -126,21 +126,33 @@ internal class SyncResponseHandler @Inject constructor(
}
// Everything else we need to do outside the transaction
aggregatorHandler.handle(aggregator)
syncResponse.rooms?.let {
checkPushRules(it, isInitialSync)
userAccountDataSyncHandler.synchronizeWithServerIfNeeded(it.invite)
dispatchInvitedRoom(it)
measureTimeMillis {
aggregatorHandler.handle(aggregator)
}.also {
Timber.v("Aggregator management took $it ms")
}
Timber.v("On sync completed")
cryptoSyncHandler.onSyncCompleted(syncResponse)
measureTimeMillis {
syncResponse.rooms?.let {
checkPushRules(it, isInitialSync)
userAccountDataSyncHandler.synchronizeWithServerIfNeeded(it.invite)
dispatchInvitedRoom(it)
}.also {
Timber.v("SyncResponse.rooms post treatment took $it ms")
}
}
measureTimeMillis {
cryptoSyncHandler.onSyncCompleted(syncResponse)
}.also {
Timber.v("cryptoSyncHandler.onSyncCompleted took $it ms")
}
// post sync stuffs
monarchy.writeAsync {
roomSyncHandler.postSyncSpaceHierarchyHandle(it)
}
Timber.v("On sync completed")
}
private fun dispatchInvitedRoom(roomsSyncResponse: RoomsSyncResponse) {

View File

@ -30,6 +30,7 @@ import org.matrix.android.sdk.internal.session.user.UserEntityFactory
import org.matrix.android.sdk.internal.session.user.accountdata.DirectChatsHelper
import org.matrix.android.sdk.internal.session.user.accountdata.UpdateUserAccountDataTask
import org.matrix.android.sdk.internal.util.awaitTransaction
import timber.log.Timber
import javax.inject.Inject
internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
@ -101,8 +102,11 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
private suspend fun List<User>.saveLocally() {
val userEntities = map { user -> UserEntityFactory.create(user) }
Timber.d("## saveLocally()")
monarchy.awaitTransaction {
Timber.d("## saveLocally() - in transaction")
it.insertOrUpdate(userEntities)
}
Timber.d("## saveLocally() - END")
}
}