Skip to content

relay: prune stale comments and compress over-detailed ones#26

Merged
floatdrop merged 1 commit into
draft-18from
docs/relay-comment-cleanup
Jun 28, 2026
Merged

relay: prune stale comments and compress over-detailed ones#26
floatdrop merged 1 commit into
draft-18from
docs/relay-comment-cleanup

Conversation

@floatdrop

Copy link
Copy Markdown
Owner

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-split track.go (now track_registry.go + track_entry.go, relay/registry: split track.go into track_registry.go and track_entry.go #23) and a non-existent newgroup.go leaf helper (only newgroup_test.go exists; the logic lives in handler_subscribe.go).
  • session_handler.go: a field comment referenced nextSubID (the field is subID); 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 cited waitForStreamEnd where the code calls session.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

  • Public-API godoc (auth.go, metrics.go, relay.go Config) — verbose but contract-only.
  • Comments carrying non-obvious, still-accurate concurrency/spec rationale.

Test plan

  • go build ./pkg/relay/...
  • go vet ./pkg/relay/
  • gofmt -l + golines length check ✅
  • Comment-only change; no behavior affected.

🤖 Generated with Claude Code

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>
@floatdrop floatdrop merged commit e1b8a10 into draft-18 Jun 28, 2026
9 checks passed
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