Skip to content

fix: dedupe activities in daily digest instead of summing per run#53

Merged
bin101 merged 1 commit into
mainfrom
fix/digest-dedupe-activities
Jul 9, 2026
Merged

fix: dedupe activities in daily digest instead of summing per run#53
bin101 merged 1 commit into
mainfrom
fix/digest-dedupe-activities

Conversation

@bin101

@bin101 bin101 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • The daily digest (build_digest_payload) summed each run's total/would_give/given counts, but the same activity typically stays in the Strava feed across several scheduler runs β€” so it was counted once per run instead of once overall.
  • RunResult and run-history entries now carry the activity IDs seen per run (activity_ids, would_give_ids, given_ids); the digest deduplicates by ID via a set, with a per-entry fallback to the old raw counts for history entries written before this change.

Test plan

  • ruff check / ruff format --check / mypy src β€” all clean
  • pytest β€” 497 passed, 88% coverage
  • New unit tests cover: dedupe of scanned activities across runs, dedupe of would-give across dry runs, dedupe of given IDs, and fallback to legacy raw sums for entries without ID lists

An activity stays in the Strava feed across several scheduler runs, so
summing each run's totals counted the same activity once per run it
appeared in. RunResult and run-history entries now carry the
scanned/would-give/given activity IDs, and build_digest_payload
deduplicates by ID (falling back to the old sums for legacy entries).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bin101
bin101 merged commit b72728d into main Jul 9, 2026
1 check passed
@bin101
bin101 deleted the fix/digest-dedupe-activities branch July 9, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant