From 91023a6572354af7770309715d1d77e978298b0d Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Jul 2026 22:51:41 -0500 Subject: fix: let pull to refresh actually refresh Home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New mail showed as unread inside a mailing list but not on Home. The list view reads threads with client.execute, so it always sees the server. Home reads them with executeCached under cacheFirstThenRefresh, which returns the cached value and only schedules a background fetch. loadDashboard had no way to bypass that, so pulling to refresh could not surface mail that arrived after the last fetch — it returned the same cache it already had and Home stayed a cycle behind. Thread forceRefresh through loadDashboard to the cached reads, and use it from the pull to refresh on Home and Work. Matches loadSystemStatus(forceRefresh:), which MoreView already refreshes this way. The staleness predates the unread baseline. It was invisible while every thread counted as unread, because Home always had a large number to show; now that Home correctly ignores mail older than sign-in, a stale cache reads as a truthful 0. --- Hutch/Views/Work/WorkView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Hutch/Views/Work/WorkView.swift') diff --git a/Hutch/Views/Work/WorkView.swift b/Hutch/Views/Work/WorkView.swift index 6ba1d0c..23acdfb 100644 --- a/Hutch/Views/Work/WorkView.swift +++ b/Hutch/Views/Work/WorkView.swift @@ -72,7 +72,7 @@ struct WorkView: View { .themedList() .listStyle(.insetGrouped) .refreshable { - await viewModel.loadDashboard() + await viewModel.loadDashboard(forceRefresh: true) } .connectivityOverlay(hasContent: hasWorkContent(viewModel)) { await viewModel.loadDashboard() -- cgit v1.2.3