mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Merge pull request #7350 from hayaksi1/fix/5766-redaction-unknown-target
Do not notify about a redaction whose target event is unknown
This commit is contained in:
+2
-2
@@ -304,8 +304,8 @@ class DefaultNotifiableEventResolver(
|
||||
// Note: this case will be handled below
|
||||
val redactedEventId = content.redactedEventId
|
||||
if (redactedEventId == null) {
|
||||
Timber.tag(loggerTag.value).d("redactedEventId is null.")
|
||||
throw NotificationResolverException.UnknownError("redactedEventId is null")
|
||||
Timber.tag(loggerTag.value).w("Ignoring redaction notification with no redactedEventId.")
|
||||
throw NotificationResolverException.EventFilteredOut
|
||||
} else {
|
||||
ResolvedPushEvent.Redaction(
|
||||
sessionId = userId,
|
||||
|
||||
+2
-1
@@ -822,7 +822,7 @@ class DefaultNotifiableEventResolverTest : RobolectricTest() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `resolve RoomRedaction with null redactedEventId should return null`() = runTest {
|
||||
fun `resolve RoomRedaction with null redactedEventId is filtered out`() = runTest {
|
||||
val sut = createDefaultNotifiableEventResolver(
|
||||
notificationResult = Result.success(
|
||||
mapOf(
|
||||
@@ -838,6 +838,7 @@ class DefaultNotifiableEventResolverTest : RobolectricTest() {
|
||||
val request = aPushRequest(A_SESSION_ID, A_ROOM_ID, AN_EVENT_ID, "firebase")
|
||||
val result = sut.resolveEvents(A_SESSION_ID, listOf(request))
|
||||
assertThat(result.getEvent(request)?.getOrNull()).isNull()
|
||||
assertThat(result.getEvent(request)?.exceptionOrNull()).isEqualTo(NotificationResolverException.EventFilteredOut)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user