From 6c4e404ba135eb755235e33d5196695dd3e55719 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 9 Mar 2022 17:56:02 +0100 Subject: [PATCH] Fix updating unread marker if not to latest chunk SetReadMarkerTask was not updating the read marker when both the old and the new fully read eventId weren't in the last chunk, even when the new one was after the first one. --- changelog.d/5481.bugfix | 1 + .../matrix/android/sdk/internal/database/query/ReadQueries.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/5481.bugfix diff --git a/changelog.d/5481.bugfix b/changelog.d/5481.bugfix new file mode 100644 index 0000000000..64891b503c --- /dev/null +++ b/changelog.d/5481.bugfix @@ -0,0 +1 @@ +Fix sometimes read marker not properly updating diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/query/ReadQueries.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/query/ReadQueries.kt index 8cc99c3d2f..cb98029aeb 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/query/ReadQueries.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/query/ReadQueries.kt @@ -94,7 +94,7 @@ internal fun isReadMarkerMoreRecent(realmConfiguration: RealmConfiguration, val eventToCheckIndex = eventToCheck?.displayIndex ?: Int.MAX_VALUE eventToCheckIndex <= readMarkerIndex } else { - eventToCheckChunk?.isLastForward == false + eventToCheckChunk?.isLastForward == false && readMarkerChunk?.isLastForward == true } } }