feat(cache): make issue/PR loading async to prevent UI freeze #368
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!368
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/356-paginate-issues-prs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
IssueView.Load and PRView.Load/LoadAll already fetch all pages (loop until exhaustion), but run synchronously blocking the UI. This moves them to goroutine + QueueUpdateDraw pattern, matching the home view approach.
LastError()Why
Multi-page API fetches (up to 10 pages × 50 items) can take seconds. Blocking the tview event loop during fetch makes the terminal unresponsive.
Closes #356
Review
Result: Approved — no blocking issues. Scope is significantly broader than the title.
Summary: Major refactor of the caching layer. Adds
PersistentCache(SQLite-backed key-value store) and genericcachedLoad[T]eliminating repeated get/set boilerplate across allCachedClientmethods. Per-key TTL viacacheTTLFor()(30s default, 5min lists, 72h immutable). Model field tags changed to enable JSON round-trip for persistent cache.Non-blocking:
get(): TTL check done outside mutex lock, could delete a fresh entry set by another goroutinepv.Reload()call removed from PRs tab handler — state filtering on load may be brokencacheKeyformat changed (nowprefix:hash) — incompatible with any hypothetical previous persisted dataChecklist: