DUP-GO-6: pagination offset/limit block duplicated in populateSessionLog and populateProjectLog #47
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#47
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?
Summary
populateSessionLog(lines 591–699) andpopulateProjectLog(lines 704–807) ininternal/db/stats.goboth end with an identical 7-line pagination block:There is also a near-identical cost-descending sort with tie-breaking by
LastRequestTimeat lines 675–681 and 784–790.Fix
Extract
paginateSlice[T](entries []T, offset, limit int) []Tusing Go generics. Extract the sort into a shared comparator.Effort
Trivial.