diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAOImpl.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAOImpl.kt index 118fd6c10de..6e32681adf6 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAOImpl.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAOImpl.kt @@ -193,16 +193,19 @@ class UserDAOImpl internal constructor( } override suspend fun updateUser(update: PartialUserEntity) = withContext(queriesContext) { - userQueries.updateUser( - name = update.name, - handle = update.handle, - email = update.email, - accent_id = update.accentId?.toLong(), - preview_asset_id = update.previewAssetId, - complete_asset_id = update.completeAssetId, - supported_protocols = update.supportedProtocols, - update.id - ).executeAsOne() > 0 + userQueries.transactionWithResult { + userQueries.updateUser( + name = update.name, + handle = update.handle, + email = update.email, + accent_id = update.accentId?.toLong(), + preview_asset_id = update.previewAssetId, + complete_asset_id = update.completeAssetId, + supported_protocols = update.supportedProtocols, + update.id + ) + userQueries.selectChanges().executeAsOne() > 0 + } } override suspend fun updateUser(users: List) = withContext(queriesContext) {