relay: prune stale comments and compress over-detailed ones#26
Merged
Conversation
Sweep pkg/relay/ docs and inline comments for staleness and verbosity: - Fix stale references: doc.go named the pre-split track.go and a non-existent newgroup.go; a subscribe comment cited waitForStreamEnd where the code calls DrainAndWait; session_handler.go referenced a nextSubID field (it is subID) and claimed upstream GOAWAY migration waits "until the UpstreamPool lands" (it has landed). - Drop "Unlike the previous DrainAndWait..." history notes that described what the code used to do. - Compress over-detailed handler/fanout/fetch docs that restated implementation specifics or duplicated adjacent inline comments. Public-API godoc (auth.go, metrics.go, relay.go Config) left intact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reviewed the comments throughout
pkg/relay/for staleness and verbosity, fixing factual drift and compressing comments that restated implementation details.Stale (factually wrong) — fixed
doc.go: source-layout map named the pre-splittrack.go(nowtrack_registry.go+track_entry.go, relay/registry: split track.go into track_registry.go and track_entry.go #23) and a non-existentnewgroup.goleaf helper (onlynewgroup_test.goexists; the logic lives inhandler_subscribe.go).session_handler.go: a field comment referencednextSubID(the field issubID); the inbound-GOAWAY doc claimed upstream migration waits "until the UpstreamPool lands" — the pool has since landed (relay_upstream_pool.go).handler_subscribe.go: comment citedwaitForStreamEndwhere the code callssession.DrainAndWait.handler_subscribe.go&handler_fetch.go: both carried an identical "Unlike the previous DrainAndWait…" history note describing what the code used to do.Compressed (removed implementation detail / duplication)
session_handler.go,handler_fanout.go,handler_fetch.go,handler_subscribe.go,handler_publish.go,handler_track_status.go,handler_datagram.go,relay.go: trimmed docs that duplicated adjacent inline comments or spelled out internals.Left intact deliberately
auth.go,metrics.go,relay.goConfig) — verbose but contract-only.Test plan
go build ./pkg/relay/...✅go vet ./pkg/relay/✅gofmt -l+golineslength check ✅🤖 Generated with Claude Code