[MEDIUM] Combine DashboardStats 3-pass reductions into a single loop #41
Labels
No labels
blocked:needs-human
blocked:verify-failed
bug
feature-request
quickfix
security/high
security/medium
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/subvault#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Location:
backend/src/services/DashboardService.tsProblem:
totalMonthly,autoPayTotal, andtrialCounteach run separate.reduce()/.filter().reduce()passes over the same subscriptions array.Impact: Traverses the same array 3 times instead of 1.
Fix: Merge into a single
.reduce()that accumulates all stats in one pass.Effort: ~30 mins