From 447abfee9004655a41228f5162224351dfc02cfb Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Sun, 3 Mar 2024 18:58:42 +0100 Subject: [PATCH] wip: Instrument calls to refresh the cached timeline A user report shows what appears to be spurious / unexpected calls to refresh the cached timeline occuring while scrolling. Have confirmed these calls aren't coming from any Pachli code, so adding additional instrumentation that can be included in a custom APK to debug further. --- .../timeline/viewmodel/CachedTimelineRemoteMediator.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt index ac18abc16..d383b11c2 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt @@ -71,6 +71,7 @@ class CachedTimelineRemoteMediator( return try { val response = when (loadType) { LoadType.REFRESH -> { + Timber.e(RuntimeException(), "Stack trace for LoadType.REFRESH") val closestItem = state.anchorPosition?.let { state.closestItemToPosition(maxOf(0, it - (state.config.pageSize / 2))) }?.status?.serverId