feat(activity): integrate fetch with cache layer #298
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!298
Loading…
Reference in a new issue
No description provided.
Delete branch "phase02-refresh"
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
Add
internal/activity/refresh.gowith the orchestration layer that ties the fetcher and cache together, completing Phase 2.RefreshContext()
The main orchestration function that:
GetActivityWindow)GetRefreshWindowsinceparameterUpsertDailyActivity)Error handling (#198)
Test mocks
mockForgeClient— returns predefined feeds, supportssincefilteringerrClient— always returns network errorsReferences: #199, #196, #197, #198
Phase 2 is now fully complete. Next: Phase 3 (Sparkline Rendering).
Testing
golangci-lint run ./internal/activity/— 0 issuesgo test ./...— all passReview
Result: Approved — no blocking issues.
Summary: Adds
internal/activity/refresh.gowithRefreshContext(), the orchestration layer tying fetcher + cache together. Flow: get cached window → check staleness → if fresh return early → fetch events with computed since → upsert each day → re-query fresh window. Graceful degradation: fetch errors return stale cache if any data exists. ROADMAP2.md updated — Phase 2 fully complete.Non-blocking:
RefreshContextChecklist: