Skip to content

chore: clean up pre-existing comment noise - #42

Merged
klabast merged 1 commit into
mainfrom
chore/comment-cleanup
Aug 28, 2026
Merged

chore: clean up pre-existing comment noise#42
klabast merged 1 commit into
mainfrom
chore/comment-cleanup

Conversation

@klabast

@klabast klabast commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Stacked on #41review/merge that one first. Based on fix/core-hardening rather than main because #41 rewrites playback/service.go, websocket/hub.go and auth/session.go, so a main-based branch would conflict on every hunk. Once #41 lands this retargets to main cleanly.

Follow-up to the comment pass in #41, applied to code that predates it. Same three patterns:

Zero-information doc comments. SetLogger sets the structured logger, SetDeviceResolver sets the device resolver, SetUserIDGetter sets the function used to extract user ID — none say anything the signature doesn't. Setters whose comment does carry something (the stream-token validator explaining the MPD fallback, SetBrowserRegistry explaining what changes when it's set) are untouched.

Listing today's callers. SendToClient enumerated the client-id welcome and the transfer handoff. That list is wrong the moment a third caller appears, and the signature already says what the function does.

History. PlayAlbumOnDevice explained itself in terms of "the bug that masked simultaneous browser+MPD playback". The rule — a device that refuses the play must not be recorded as playing — is what a reader actually needs, and it stays true regardless of which bug prompted it. ServeWs called the hub-assigned counter "the old monotonic counter" while still using it as the live fallback, which reads as dead code that isn't.

one thing I did not do, on purpose

There are ~20 // NewX creates a new X constructor comments. They're just as empty, but they're the house convention throughout the repo and they match Go's own doc style, so follow-patterns.md and comments.md point in opposite directions here. Removing five and leaving fifteen is worse than leaving all twenty — it's a repo-wide style call, and yours to make. Say the word and I'll do them all in one sweep.

Comment-only; no behaviour change. gofmt, go vet, go build and the full suite green.

🤖 Generated with Claude Code

Base automatically changed from fix/core-hardening to main August 28, 2026 07:51
Same three patterns as the previous pass, in code that predates it.

Zero-information doc comments. "SetLogger sets the structured logger",
"SetDeviceResolver sets the device resolver", "SetUserIDGetter sets the
function used to extract user ID" — none of them say anything the
signature doesn't. Setters whose comment does carry something (the
stream-token validator explaining the MPD fallback, SetBrowserRegistry
explaining what changes when it's set) are left alone.

Listing today's callers. SendToClient enumerated the client-id welcome
and the transfer handoff; that list is wrong the moment a third caller
appears, and the signature already says what the function does.

History. PlayAlbumOnDevice explained itself in terms of "the bug that
masked simultaneous browser+MPD playback" — the rule (a device that
refuses the play must not be recorded as playing) is what a reader
needs, and it stays true regardless of which bug prompted it. ServeWs
called the hub-assigned counter "the old monotonic counter" while still
using it as the live fallback, which reads as dead code that isn't.

Deliberately not touched: the ~20 "NewX creates a new X" constructor
comments. They're equally empty, but they're the house convention and
Go's own doc style; removing five and leaving fifteen would be worse
than leaving all of them. Worth a decision either way, repo-wide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@klabast
klabast force-pushed the chore/comment-cleanup branch from b11bd07 to 35a728a Compare August 28, 2026 07:52
@klabast
klabast merged commit d22ec3c into main Aug 28, 2026
5 checks passed
@klabast
klabast deleted the chore/comment-cleanup branch August 28, 2026 08:03
klabast added a commit that referenced this pull request Aug 28, 2026
pull_request runs the commit stage only; merge_group runs the full
pipeline against trunk + the queued change (the gate); push to main runs
it again and promotes.

Fixes three gaps found while merging #40/#41/#42: acceptance only ran
after merge, nothing tested the prospective combination, and promote was
an unguarded race on :latest where last writer wins.

ADR in docs/adr/0001-trunk-based-delivery-pipeline.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant