adding extra logging around the push rules to help determine if we're incorrectly filter out valid notifications
This commit is contained in:
parent
a6ae709fe9
commit
9119cf059f
@ -74,6 +74,7 @@ internal class DefaultProcessEventForPushTask @Inject constructor(
|
|||||||
event to it
|
event to it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Timber.d("[PushRules] matched ${matchedEvents.size} out of ${allEvents.size}")
|
||||||
|
|
||||||
val allRedactedEvents = params.syncResponse.join
|
val allRedactedEvents = params.syncResponse.join
|
||||||
.asSequence()
|
.asSequence()
|
||||||
|
@ -20,6 +20,7 @@ import im.vector.app.features.invite.AutoAcceptInvites
|
|||||||
import im.vector.app.features.notifications.ProcessedEvent.Type.KEEP
|
import im.vector.app.features.notifications.ProcessedEvent.Type.KEEP
|
||||||
import im.vector.app.features.notifications.ProcessedEvent.Type.REMOVE
|
import im.vector.app.features.notifications.ProcessedEvent.Type.REMOVE
|
||||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||||
|
import timber.log.Timber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
private typealias ProcessedEvents = List<ProcessedEvent<NotifiableEvent>>
|
private typealias ProcessedEvents = List<ProcessedEvent<NotifiableEvent>>
|
||||||
@ -33,9 +34,13 @@ class NotifiableEventProcessor @Inject constructor(
|
|||||||
val processedEvents = queuedEvents.map {
|
val processedEvents = queuedEvents.map {
|
||||||
val type = when (it) {
|
val type = when (it) {
|
||||||
is InviteNotifiableEvent -> if (autoAcceptInvites.hideInvites) REMOVE else KEEP
|
is InviteNotifiableEvent -> if (autoAcceptInvites.hideInvites) REMOVE else KEEP
|
||||||
is NotifiableMessageEvent -> if (shouldIgnoreMessageEventInRoom(currentRoomId, it.roomId) || outdatedDetector.isMessageOutdated(it)) {
|
is NotifiableMessageEvent -> when {
|
||||||
REMOVE
|
shouldIgnoreMessageEventInRoom(currentRoomId, it.roomId) -> REMOVE
|
||||||
} else KEEP
|
.also { Timber.d("notification message removed due to currently viewing the same room") }
|
||||||
|
outdatedDetector.isMessageOutdated(it) -> REMOVE
|
||||||
|
.also { Timber.d("notification message removed due to being read") }
|
||||||
|
else -> KEEP
|
||||||
|
}
|
||||||
is SimpleNotifiableEvent -> when (it.type) {
|
is SimpleNotifiableEvent -> when (it.type) {
|
||||||
EventType.REDACTION -> REMOVE
|
EventType.REDACTION -> REMOVE
|
||||||
else -> KEEP
|
else -> KEEP
|
||||||
|
@ -55,12 +55,12 @@ class PushRuleTriggerListener @Inject constructor(
|
|||||||
|
|
||||||
private suspend fun createNotifiableEvents(pushEvents: PushEvents, session: Session): List<NotifiableEvent> {
|
private suspend fun createNotifiableEvents(pushEvents: PushEvents, session: Session): List<NotifiableEvent> {
|
||||||
return pushEvents.matchedEvents.mapNotNull { (event, pushRule) ->
|
return pushEvents.matchedEvents.mapNotNull { (event, pushRule) ->
|
||||||
Timber.v("Push rule match for event ${event.eventId}")
|
Timber.d("Push rule match for event ${event.eventId}")
|
||||||
val action = pushRule.getActions().toNotificationAction()
|
val action = pushRule.getActions().toNotificationAction()
|
||||||
if (action.shouldNotify) {
|
if (action.shouldNotify) {
|
||||||
resolver.resolveEvent(event, session, isNoisy = !action.soundName.isNullOrBlank())
|
resolver.resolveEvent(event, session, isNoisy = !action.soundName.isNullOrBlank())
|
||||||
} else {
|
} else {
|
||||||
Timber.v("Matched push rule is set to not notify")
|
Timber.d("Matched push rule is set to not notify")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user