Skip to content

fix: paginate event fetching and show actual date range in title#1

Open
bendrighes wants to merge 1 commit intoAnthonyeef:mainfrom
bendrighes:fix/pagination-and-date-range-title
Open

fix: paginate event fetching and show actual date range in title#1
bendrighes wants to merge 1 commit intoAnthonyeef:mainfrom
bendrighes:fix/pagination-and-date-range-title

Conversation

@bendrighes
Copy link

Summary

  • Fix pagination: fetchUsageEvents previously only fetched page 1 (up to 100 events), silently truncating results for date ranges with more than 100 events. It now loops through all pages until all events are retrieved.
  • Fix report title: The daily report title now shows the actual date range (e.g. 2026-01-01 to 2026-02-17) when --since/--until flags are used, instead of always showing "Last N days".

Test plan

  • Run cursor-usage daily --since <date> --until <date> over a range with >100 events and verify all days appear
  • Verify the title reflects the actual date range when using --since/--until
  • Verify cursor-usage daily 30 still shows "Last 30 days" in the title

🤖 Generated with Claude Code

- fetchUsageEvents now loops through all pages instead of stopping at page 1, fixing truncated results when date ranges contain more than 100 events
- Daily report title now shows the actual date range (e.g. "2026-01-01 to 2026-02-17") when --since/--until flags are used, instead of always showing "Last N days"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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