feat(activity): optimize API fetch strategy for immutable dates #324

Merged
fuzzy merged 1 commit from phase07-fetch-optimization into main 2026-07-07 12:52:21 +00:00
Owner

What

Add test coverage for the existing fetch optimization, completing #262.

Changes

  • New test: TestGetRefreshWindowPastDatesImmutable — verifies that when past dates are all cached and today is missing, since points to today (not an earlier date), preventing redundant fetches for immutable past data
  • Already implemented:
    • isDateImmutable() + isCacheStale() prevent fetches for past dates (never stale)
    • GetRefreshWindow() computes since from the earliest stale/missing day in the window
    • FetchActivityEvents() batches all graph types in one paginated API call
  • Not done: #261 If-Modified-Since requires HTTP-level support at the forge client layer

References: #262, #259, #260

Testing

  • 1 new test: past dates immutable optimization (since= today start, not earlier)
  • go test -race ./... — all pass
## What Add test coverage for the existing fetch optimization, completing #262. ### Changes - **New test**: `TestGetRefreshWindowPastDatesImmutable` — verifies that when past dates are all cached and today is missing, `since` points to today (not an earlier date), preventing redundant fetches for immutable past data - **Already implemented**: - `isDateImmutable()` + `isCacheStale()` prevent fetches for past dates (never stale) - `GetRefreshWindow()` computes `since` from the earliest stale/missing day in the window - `FetchActivityEvents()` batches all graph types in one paginated API call - **Not done**: `#261` If-Modified-Since requires HTTP-level support at the forge client layer References: #262, #259, #260 ## Testing - [x] 1 new test: past dates immutable optimization (since= today start, not earlier) - [x] `go test -race ./...` — all pass
feat(activity): optimize API fetch strategy for immutable dates
All checks were successful
Test and Release / lint (pull_request) Successful in 3m24s
Test and Release / test (pull_request) Successful in 10m12s
5ff3f6a701
- GetRefreshWindow past-dates test: verify since param points to
  today, not earlier past dates, when past dates are all cached
- isDateImmutable + isCacheStale ensure past dates never trigger
  fetches (already implemented, now tested)
- FetchActivityEvents batches all graph types in one API call
  (already the case)
- Conditional requests (If-Modified-Since) left for future HTTP-level
  work in forge client layer

Ref: #262, #259, #260
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-07 12:42:47 +00:00
fuzzy self-assigned this 2026-07-07 12:42:50 +00:00
fuzzy added this to the Steeper project 2026-07-07 12:42:53 +00:00
the.auditor left a comment

Review

Result: Approved — no blocking issues.

Summary: Tests-only PR. TestGetRefreshWindowPastDatesImmutable verifies that when all past dates are cached and only today is missing, since points to today (not earlier), preventing redundant fetches for immutable past data. ROADMAP2.md updated — #259 and #260 complete.

Checklist:

  • Correctness: Test confirms optimization — since points to today, not window start
  • Completeness: Covers the immutable dates optimization path
  • Test coverage: 1 new test verifying past dates don't trigger redundant fetches
  • Race-safe: go test -race passes
## Review **Result: Approved** — no blocking issues. **Summary:** Tests-only PR. `TestGetRefreshWindowPastDatesImmutable` verifies that when all past dates are cached and only today is missing, `since` points to today (not earlier), preventing redundant fetches for immutable past data. ROADMAP2.md updated — #259 and #260 complete. **Checklist:** - Correctness: ✅ Test confirms optimization — since points to today, not window start - Completeness: ✅ Covers the immutable dates optimization path - Test coverage: ✅ 1 new test verifying past dates don't trigger redundant fetches - Race-safe: ✅ `go test -race` passes
fuzzy merged commit 5ff3f6a701 into main 2026-07-07 12:52:21 +00:00
fuzzy deleted branch phase07-fetch-optimization 2026-07-07 12:52:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper!324
No description provided.