1 KiB
1 KiB
Code Review: Message Handling & Link Logic
Scope
internal/handler/internal/detector/internal/resolver/internal/services/
Findings
✅ Strengths
- Clear separation between detection, resolution, and formatting.
- Resolver wraps API errors with context; bounded error body capture improves diagnostics.
- Service ordering is explicit and consistent in formatting output.
⚠️ Issues / Opportunities
-
Detector regex is brittle
- Centralized regex is dense and risks missing edge cases; updates require careful regex edits.
- Consider migrating to per-service patterns or table-driven detection.
-
Plain-text only parsing
HandleTextonly uses rawbody; formatted/HTML links are ignored.- Decision made to keep plaintext-only; document this limitation.
-
Single-link handling
- Handler uses
links[0]only; multiple links ignored (by design). - Explicitly document or consider multi-link responses in future.
- Handler uses
Notes
- Qobuz now supported end-to-end (detector + mapping + formatter).