From 9db245f6097145d79328b47f01f784c66822de33 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Baur" <1097224+believethehype@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:39:55 +0200 Subject: [PATCH] fix: make Discover's pull-to-refresh re-issue the discovery REQs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull-to-refresh only re-read the cache (invalidateData), so when cached beats were stale it showed the loss instead of fixing it. The DVM tab's refresh now also invalidates the discovery assembler, re-issuing the 31990 REQ and both heartbeat streams (global + outbox batches) with fresh rolling windows — beats repopulate in seconds instead of whenever the open REQs happen to deliver. --- .../ui/screen/loggedIn/discover/DiscoverScreen.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt index 833e843078..a5a4106e7b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/DiscoverScreen.kt @@ -278,7 +278,18 @@ private fun DiscoverPages( HorizontalPager(state = pagerState) { page -> if (page >= 0 && page < feedTabs.size) { val tab = feedTabs[page] - RefresheableBox(tab.feedState, true) { + RefresheableBox( + onRefresh = { + tab.feedState.invalidateData() + // The DVM tab's freshness gate lives or dies with beat delivery, and + // invalidateData only re-reads the cache — re-issue the discovery REQs + // (31990 + both heartbeat streams) with fresh rolling windows so refresh + // actually fetches. + if (tab.feedState == accountViewModel.feedStates.discoverDVMs) { + accountViewModel.dataSources().discovery.invalidateFilters() + } + }, + ) { if (tab.useGridLayout) { SaveableGridFeedContentState(tab.feedState, scrollStateKey = tab.scrollStateKey) { listState -> RenderDiscoverFeed(