-
Notifications
You must be signed in to change notification settings - Fork 16
Chart displays only partial data despite having records in database #231
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingplannedreported-againMultiple users reported this issueMultiple users reported this issuevalidated
Description
Description
When viewing charts with Weekly granularity, only a small number of records are displayed even though there are hundreds of records in the database.
Root Cause
The bounds check in DataBuckets::addRow() at line 209 is incorrect:
if ($offset <= $this->points) {This condition has two problems:
- It allows negative offsets (which should be rejected)
- It uses
<=instead of<, which can cause out-of-bounds access
Solution
Change the bounds check to:
if ($offset >= 0 && $offset < $this->points) {Affected File
src/Helpers/DataBuckets.php line 209
Steps to Reproduce
- Have a site with hundreds of pageview records in the database
- Go to SlimStat dashboard
- Select Weekly granularity for the chart
- Observe that only a few records are displayed
Expected Behavior
All records within the selected date range should be displayed in the chart.
Actual Behavior
Only a small subset of records is displayed (e.g., 3 instead of hundreds).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingplannedreported-againMultiple users reported this issueMultiple users reported this issuevalidated