fix: make Discover's pull-to-refresh re-issue the discovery REQs

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.
This commit is contained in:
Dr. Tobias Baur
2026-09-10 15:39:55 +02:00
parent 5a4002e256
commit 9db245f609
@@ -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(