[TMP] Update some readmarker debugging
Change-Id: Ia1de156f39622d90cc1433f0b16776bd00e2a462
This commit is contained in:
parent
12e4853c59
commit
6aabb38c3b
|
@ -2039,6 +2039,7 @@ class TimelineFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onLoadMore(direction: Timeline.Direction) {
|
||||
Timber.i("ReadMarker debug: on load more $direction")
|
||||
timelineViewModel.handle(RoomDetailAction.LoadMoreTimelineEvents(direction))
|
||||
}
|
||||
|
||||
|
|
|
@ -638,6 +638,7 @@ class TimelineViewModel @AssistedInject constructor(
|
|||
if (trackUnreadMessages.getAndSet(false)) {
|
||||
mostRecentDisplayedEvent?.root?.eventId?.also {
|
||||
session.coroutineScope.launch(NonCancellable) {
|
||||
Timber.i("ReadMarker debug: set RM and RR to $it")
|
||||
tryOrNull { room.setReadMarker(it) }
|
||||
if (loadRoomAtFirstUnread()) {
|
||||
tryOrNull { room.setReadReceipt(it) }
|
||||
|
@ -1127,6 +1128,7 @@ class TimelineViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
.setOnEach {
|
||||
Timber.i("ReadMarker debug: update unreadState = $it")
|
||||
copy(unreadState = it)
|
||||
}
|
||||
}
|
||||
|
@ -1156,11 +1158,13 @@ class TimelineViewModel @AssistedInject constructor(
|
|||
if (!isFromMe) {
|
||||
return UnreadState.HasUnread(eventId)
|
||||
}
|
||||
Timber.i("ReadMarker debug: hasNoUnread / firstDisplayableEventIndex: $firstDisplayableEventIndex / " +
|
||||
"latest previewable from summary ${roomSummary.latestPreviewableOriginalContentEvent?.eventId} - ${timeline.getIndexOfEvent(roomSummary.latestPreviewableOriginalContentEvent?.eventId)} / " +
|
||||
"event-0 ${events.getOrNull(0)?.eventId}")
|
||||
}
|
||||
Timber.i("ReadMarker debug: hasNoUnread / firstDisplayableEventIndex: $firstDisplayableEventIndex / " +
|
||||
"latest previewable from summary ${roomSummary.latestPreviewableOriginalContentEvent?.eventId} - ${timeline.getIndexOfEvent(roomSummary.latestPreviewableOriginalContentEvent?.eventId)} / " +
|
||||
"event-0 ${events.getOrNull(0)?.eventId}")
|
||||
// TODO: if we return HasNoUnread, we need to be sure, since later HasUnread will be ignored in distinctUntilChanged. However, when loading the room at the last read directly, this doesn't always work
|
||||
return UnreadState.HasNoUnread
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue