Skip to content

fix: use start/end bounds in hourly filter instead of undefined cutoff#121

Closed
tswicegood wants to merge 1 commit into
phuryn:mainfrom
tswicegood:fix/hourly-filter-undefined-cutoff
Closed

fix: use start/end bounds in hourly filter instead of undefined cutoff#121
tswicegood wants to merge 1 commit into
phuryn:mainfrom
tswicegood:fix/hourly-filter-undefined-cutoff

Conversation

@tswicegood
Copy link
Copy Markdown

Summary

The dashboard throws a JS error on every load:

(index):1097 ReferenceError: cutoff is not defined
    at (index):622:38
    at Array.filter (<anonymous>)
    at applyFilter ((index):621:53)
    at loadData ((index):1095:5)

The hourly aggregation filter in applyFilter() references a cutoff variable that doesn't exist in scope — it looks like a leftover from an earlier iteration. The surrounding daily/sessions filters use start / end from getRangeBounds(selectedRange). This PR switches the hourly filter to the same bounds so it matches the rest of the code and the error goes away.

  • One-line change in dashboard.py
  • Hourly data is now range-filtered consistently with the daily and sessions filters (both lower and upper bound)

Test plan

  • Open the dashboard — no console error on load
  • Switch ranges (week, month, prev-month, 7d, 30d, 90d, all) — Average Hourly Distribution chart updates and only includes hours from the selected range
  • Toggle Local / UTC — hourly chart re-buckets correctly

🤖 Generated with Claude Code

The hourly aggregation filter referenced a `cutoff` variable that doesn't
exist in scope, throwing "ReferenceError: cutoff is not defined" on
dashboard load. Switch to the same `start`/`end` bounds the daily filter
uses (from getRangeBounds(selectedRange)) so hourly data is range-filtered
consistently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tswicegood
Copy link
Copy Markdown
Author

Just realized this is a duplicate of #117.

@tswicegood tswicegood closed this May 17, 2026
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