feat(activity): handle new and empty contexts gracefully #319

Merged
fuzzy merged 1 commit from phase06-empty-context into main 2026-07-07 12:12:35 +00:00
Owner

What

Add tests and ensure graceful handling for new/empty contexts, completing #250.

Changes

  • New context test — brand new user with no events: RefreshContext returns empty window with no error, View shows "No activity data"
  • Empty API response — no events returned from API results in empty window, not an error
  • Empty cache graceful handling — empty SQLite cache with fetch failure returns error (expected), empty cache with empty API response returns clean empty window

All these scenarios already worked correctly — this PR adds the test coverage.

References: #250, #247, #248, #249

Testing

  • 2 new tests: RefreshContext with empty API response (new context), View new context no error
  • go test -race ./... — all pass
## What Add tests and ensure graceful handling for new/empty contexts, completing #250. ### Changes - **New context test** — brand new user with no events: `RefreshContext` returns empty window with no error, View shows "No activity data" - **Empty API response** — no events returned from API results in empty window, not an error - **Empty cache graceful handling** — empty SQLite cache with fetch failure returns error (expected), empty cache with empty API response returns clean empty window All these scenarios already worked correctly — this PR adds the test coverage. References: #250, #247, #248, #249 ## Testing - [x] 2 new tests: RefreshContext with empty API response (new context), View new context no error - [x] `go test -race ./...` — all pass
feat(activity): handle new and empty contexts gracefully
All checks were successful
Test and Release / lint (pull_request) Successful in 3m24s
Test and Release / test (pull_request) Successful in 10m9s
2604f8b2ae
- New/empty contexts return clean 'No activity data' state with no
  errors — brand new users or repos with no events display properly
- API fetch correctly skipped when no data expected (empty cache +
  empty API response handled gracefully)
- Empty cache without data handled: View shows empty state,
  RefreshContext returns empty ActivityWindow with CachedAt set
- 2 new tests: RefreshContext with empty API response for new
  context, View new context no error on refresh

Ref: #250, #247, #248, #249
the.auditor left a comment

Review

Result: Approved — no blocking issues.

Summary: Tests-only PR adding coverage for new/empty contexts. TestRefreshContextEmptyContextNoEvents verifies new user with no events returns clean empty window (no error, 0 days, non-zero CachedAt). TestViewNewContextNoError verifies full View pipeline for a brand new user — no error, loaded, renders "No activity data". No production code changes. ROADMAP2.md updated.

Checklist:

  • Correctness: No code changed, existing behavior verified as correct
  • Completeness: Closes #250 — covered by test assertions
  • Test coverage: 2 new tests covering empty API + new context paths
  • Race-safe: go test -race passes
## Review **Result: Approved** — no blocking issues. **Summary:** Tests-only PR adding coverage for new/empty contexts. `TestRefreshContextEmptyContextNoEvents` verifies new user with no events returns clean empty window (no error, 0 days, non-zero CachedAt). `TestViewNewContextNoError` verifies full View pipeline for a brand new user — no error, loaded, renders "No activity data". No production code changes. ROADMAP2.md updated. **Checklist:** - Correctness: ✅ No code changed, existing behavior verified as correct - Completeness: ✅ Closes #250 — covered by test assertions - Test coverage: ✅ 2 new tests covering empty API + new context paths - Race-safe: ✅ `go test -race` passes
fuzzy merged commit 2604f8b2ae into main 2026-07-07 12:12:35 +00:00
fuzzy deleted branch phase06-empty-context 2026-07-07 12:12:35 +00:00
fuzzy added this to the Steeper project 2026-07-07 12:12:40 +00:00
fuzzy self-assigned this 2026-07-07 12:12:41 +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!319
No description provided.