Fix / fetch from realm without copy (proxy error)

This commit is contained in:
Valere 2019-06-24 10:12:11 +02:00 committed by Benoit Marty
parent c01af6ac78
commit 7821ca12fd
2 changed files with 4 additions and 5 deletions

View File

@ -30,6 +30,7 @@ import im.vector.matrix.android.internal.database.query.where
import im.vector.matrix.android.internal.session.pushers.GetPushRulesTask
import im.vector.matrix.android.internal.task.TaskExecutor
import im.vector.matrix.android.internal.task.configureWith
import timber.log.Timber
internal class DefaultPushRuleService(
@ -170,7 +171,7 @@ internal class DefaultPushRuleService(
it.onMatchRule(event, Action.mapFrom(rule) ?: emptyList())
}
} catch (e: Throwable) {
Timber.e(e, "Error while dispatching bing")
}
}

View File

@ -33,6 +33,7 @@ import im.vector.matrix.android.internal.database.mapper.asDomain
import im.vector.matrix.android.internal.database.model.RoomSummaryEntity
import im.vector.matrix.android.internal.database.model.RoomSummaryEntityFields
import im.vector.matrix.android.internal.database.query.where
import im.vector.matrix.android.internal.util.fetchCopied
internal class DefaultRoom(
override val roomId: String,
@ -70,10 +71,7 @@ internal class DefaultRoom(
override val roomSummary: RoomSummary?
get() {
var sum: RoomSummaryEntity? = null
monarchy.runTransactionSync {
sum = RoomSummaryEntity.where(it, roomId).isNotEmpty(RoomSummaryEntityFields.DISPLAY_NAME).findFirst()
}
var sum: RoomSummaryEntity? = monarchy.fetchCopied { RoomSummaryEntity.where(it, roomId).isNotEmpty(RoomSummaryEntityFields.DISPLAY_NAME).findFirst() }
return sum?.asDomain()
}