summaryrefslogtreecommitdiff
path: root/Hutch/Views/Pastes/PasteListViewModel.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-05-06 20:41:49 -0500
committerChristian Cleberg <[email protected]>2026-05-06 20:41:49 -0500
commit205cf2687ce48f3d004792ff223422a86cc6bdbc (patch)
tree7edb78cede354e79aa8abd764ed9c5047e0ee168 /Hutch/Views/Pastes/PasteListViewModel.swift
parent57e4f34b4613c09beb0cb757ac2ba2b43cc04daf (diff)
downloadhutch-3.3.1.tar.gz
hutch-3.3.1.tar.bz2
hutch-3.3.1.zip
feat(cache): persist read-only API responsesv3.3.1
Add a bounded stale-while-revalidate cache at the Sourcehut API boundary with stable keys, centralized TTLs, request coalescing, payload hashing, and LRU disk pruning. Cache high-value read-only repo, build, ticket, project, profile, paste, and Home/Work Queue data while keeping mutations network-only and invalidating related prefixes after successful writes. Add focused cache tests and implementation notes.
Diffstat (limited to 'Hutch/Views/Pastes/PasteListViewModel.swift')
-rw-r--r--Hutch/Views/Pastes/PasteListViewModel.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/Hutch/Views/Pastes/PasteListViewModel.swift b/Hutch/Views/Pastes/PasteListViewModel.swift
index 640e31b..059dfa0 100644
--- a/Hutch/Views/Pastes/PasteListViewModel.swift
+++ b/Hutch/Views/Pastes/PasteListViewModel.swift
@@ -43,7 +43,7 @@ final class PasteListViewModel {
}
func loadPastes() async {
- if pastes.isEmpty, let cached = service.loadCachedPastes() {
+ if pastes.isEmpty, let cached = await service.loadCachedPastes() {
pastes = cached.results
cursor = cached.cursor
hasMore = cached.cursor != nil