Skip to content

fix: resolve calendar field shadowing, Retry-After header, log ordering, CHANGELOG - #36

Closed
calmcacil wants to merge 1 commit into
mainfrom
fix/arch-review-findings
Closed

fix: resolve calendar field shadowing, Retry-After header, log ordering, CHANGELOG#36
calmcacil wants to merge 1 commit into
mainfrom
fix/arch-review-findings

Conversation

@calmcacil

Copy link
Copy Markdown
Owner

Changes

Four fixes from the second architecture review:

1. Calendar field shadowing

Removed redundant WatchMode/WatchSeconds fields from calendar.ToolConfig that silently shadowed the embedded core.CommonConfig.Watch/core.CommonConfig.WatchSeconds. Renamed cfg.WatchModecfg.Watch (3 occurrences in render.go, 1 in main.go). Now the embedding is real instead of half-broken.

2. HTTP Retry-After header support

parseRetryAfter was only parsing the JSON response body for a retryAfter field. Added parseRetryAfterHeader that reads the standard HTTP Retry-After header (RFC 7231 §7.1.3). Sonarr/Radarr return this as a header. Modified DoRequest to extract it from the response and return alongside body/status. doWithRetry prefers the header value and falls back to body parsing.

3. LoadAndValidate log ordering

Replaced slogx.Default().Warn(...) with fmt.Fprintf(os.Stderr, ...) in LoadAndValidate. Startup diagnostics were emitted before the slog logger was configured (since LoadAndValidate runs before flag.Parse/Apply), causing text-only output even under --json.

4. CHANGELOG doc fix

Removed the incorrect line claiming NewTransportClient (dead code) was removed. NewTransportClient is still used by calendar.go and airtime.go.


  • Branch: fix/arch-review-findings
  • Base: main
  • gofmt, go vet, go build, go test -race: all clean

…ng, CHANGELOG

Fixes from second architecture review:

- Remove shadowing WatchMode/WatchSeconds fields from calendar.ToolConfig
  (the outer fields silently shadowed embedded core.CommonConfig.Watch and
  core.CommonConfig.WatchSeconds; renamed cfg.WatchMode -> cfg.Watch)
- Add HTTP Retry-After header support to DoRequest (was only parsing
  JSON body for retryAfter, ignoring the standard header; now prefers
  the header and falls back to body parsing)
- Replace slogx.Default().Warn() with fmt.Fprintf in LoadAndValidate
  (startup warming was emitted before logger was configured, causing
  text-only format even under --json)
- Fix CHANGELOG incorrectly claiming NewTransportClient was removed
@calmcacil

Copy link
Copy Markdown
Owner Author

Superseded by the unified CLI modernization in #37; closing before the public-history sanitization.

@calmcacil calmcacil closed this Jul 15, 2026
@calmcacil
calmcacil deleted the fix/arch-review-findings branch July 15, 2026 15:06
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