Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The PR description currently lists frontend changes that are not present in this diff, which can mislead reviewers/testers about scope and verification steps.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes the “Task Completed” chart’s task counts by applying the selected date range to the non-comparison getTasksStats aggregation, so results reflect tasks modified within the requested period instead of all-time totals.
Changes:
- Add a
$matchstage in the non-comparisonTask.aggregate()pipeline to filter bymodifiedDatetimebetweenstartDateandendDate. - Update the inline comment describing the non-comparison branch behavior (and align it with the actual query semantics).
File summaries
| File | Description |
|---|---|
| src/helpers/overviewReportHelper.js | Filters non-comparison task status aggregation by the requested date range to avoid all-time task counts. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // non-comparison branch — filter by the same date range so the count reflects | ||
| // tasks modified (completed/activated) within the selected period, not all time. |
|



Description
Related PRS (if any):
This backend PR is related to the #5489 frontend PR.
To test this backend PR you need to checkout the #XXX frontend PR.
…
Main changes explained:
getTasksStatsfunction inoverviewReportHelper.jsto include a date filter on the non-comparison branch of the aggregation query. Previously, the query had no date constraint and countedevery task ever created in the system regardless of the selected date range. The fix count to tasks modified within the selected startDate and endDate, consistent with how the Hours Completed chart already filters its data.
…
How to test:
npm installand run this PR locallya. With the date range 6/26/2026 – 8/21/2026, the subtitle should read something like x% of Total Logged Hours (Tasks) | y% of Total Logged Hours (Projects) - both values visible, not just Tasks.
b. The percentage in parentheses on each bar should match the footer split. Previously bars showed (0.00%) and (1.00%) while the footer showed 31.3% and 68.7%. After the fix, the bar labels should show the correct percentages respectively not 0% or 1%.
c. Previously showed 1275 completed tasks for the date range 6/26/2026 – 8/21/2026. After the fix, re-run with the same date range and verify the count drops significantly to a number that is realistic for that ~2 month window.
Note:
Note that the local pre-commit related-test command may still fail because the unrelated reasonSchedulingController integration tests cannot connect to the local test database; the backend build itself succeeds.