DUP-GO-1: platform fan-out loop duplicated in handleSessions and handleSessionsNotify #44
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#44
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
handleSessions(lines 26–101) andhandleSessionsNotify(lines 133–180) ininternal/server/handlers_sessions.goboth contain an identical ~15-line loop that iterates over all registered platform adapters, callsadapter.Sessions(), collects results, and callssortAndLimitSessions+applySessionState.Fix
Extract a private
gatherSessions(ctx, dir string, since, limit)helper covering the common loop. The two handlers then differ only in their post-gather steps (pinned force-include, summary projection).Effort
Trivial.
Already fixed on main: handleSessions and handleSessionsNotify both delegate to the shared fanOutSessions helper (internal/server/fanout.go). Can be closed as done — see PR #220 for the remaining DUP-GO items.