diff options
| author | Christian Cleberg <[email protected]> | 2026-05-06 20:41:49 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-05-06 20:41:49 -0500 |
| commit | 205cf2687ce48f3d004792ff223422a86cc6bdbc (patch) | |
| tree | 7edb78cede354e79aa8abd764ed9c5047e0ee168 /Hutch/Views/Pastes/PasteListViewModel.swift | |
| parent | 57e4f34b4613c09beb0cb757ac2ba2b43cc04daf (diff) | |
| download | hutch-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.swift | 2 |
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 |
