diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt index c4ea029cbb..a66a8540e7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UpdateBreadcrumbsTask.kt @@ -17,6 +17,7 @@ package org.matrix.android.sdk.internal.session.user.accountdata import com.zhuinden.monarchy.Monarchy +import org.matrix.android.sdk.api.session.room.model.localecho.RoomLocalEcho import org.matrix.android.sdk.internal.database.model.BreadcrumbsEntity import org.matrix.android.sdk.internal.database.query.get import org.matrix.android.sdk.internal.di.SessionDatabase @@ -41,6 +42,8 @@ internal class DefaultUpdateBreadcrumbsTask @Inject constructor( ) : UpdateBreadcrumbsTask { override suspend fun execute(params: UpdateBreadcrumbsTask.Params) { + // Do not add local rooms to the recent rooms list as they should not be known by the server + if (RoomLocalEcho.isLocalEchoId(params.newTopRoomId)) return val newBreadcrumbs = // Get the breadcrumbs entity, if any monarchy.fetchCopied { BreadcrumbsEntity.get(it) }