From f265a47243157c9abc769a65905658571cd3e688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Fri, 28 Nov 2025 08:25:26 +0100 Subject: [PATCH] Make sure we don't finish `NotificationTapOpensTimeline` until we've actually rendered the timeline event we need to focus on --- .../features/messages/impl/timeline/TimelinePresenter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt index 127dab0345..7b8ff837c1 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt @@ -206,6 +206,9 @@ class TimelinePresenter( focusOnEvent(event.eventId, focusRequestState) }.start() is TimelineEvents.OnFocusEventRender -> { + // If there was a pending 'notification tap opens timeline' transaction, finish it now we're focused in the required event + analyticsService.finishLongRunningTransaction(NotificationTapOpensTimeline) + focusRequestState.value = focusRequestState.value.onFocusEventRender() } is TimelineEvents.ClearFocusRequestState -> { @@ -242,7 +245,6 @@ class TimelinePresenter( analyticsService.run { finishLongRunningTransaction(DisplayFirstTimelineItems) finishLongRunningTransaction(OpenRoom) - finishLongRunningTransaction(NotificationTapOpensTimeline) } } .launchIn(this)