Centralize Unbounded configuration equality and STUN normalization - #34
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain.
Pull request overview
Centralizes UnboundedConfig equality and STUN normalization in Common.
Changes:
- Adds nil-safe equality with normalized STUN pools.
- Adds sorting, deduplication, trimming, and fallback handling.
- Adds comprehensive tests, including slice isolation.
File summaries
| File | Description |
|---|---|
types.go |
Implements configuration equality and STUN normalization. |
types_test.go |
Tests equality, fallback behavior, normalization, and slice isolation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move effective donor configuration equality and STUN normalization into Common, alongside
UnboundedConfigand its fallback pool. Radiance can useUnboundedConfig.Equalto decide when to restart andNormalizeDonorSTUNServerswhen constructing the worker's STUN sampler.Equality compares all configuration fields, treats STUN ordering, duplicates, and surrounding whitespace as insignificant, and treats empty pools as the default pool. Nil configurations equal only nil configurations. Normalization returns an independent slice without modifying its input.
Companion: getlantern/radiance#634. Based on
atavism/usermessage, where #33 merged.Validation:
go test ./... -timeout=90s, including each config field, nil handling, equivalent pools, fallback behavior, and slice isolation.