Logging System Panic Resolution (#1468) - Community Contribution by @d0ugal
- Problem: Application crashes on startup with panic:
interface conversion: interface {} is int64, not slog.Level - Root Cause: Using reserved
slogkey "level" as an attribute name in threshold persistence logging - Reserved Keys in Go slog:
time,level,msg,sourceare automatically treated as log metadata, not regular attributes - Impact:
- Startup failures on systems using dynamic threshold persistence (introduced in nightly-20251026)
- Panic occurred during threshold loading when logging used
"level"attribute conflicting withslog.LevelKey
- Solution: Two-part fix for robustness
- Changed attribute key from
"level"to"threshold_level"in threshold persistence logging - Added safety check in
defaultReplaceAttrto gracefully handle type mismatches instead of panicking
- Changed attribute key from
- Testing: Comprehensive test coverage with 48 test cases verifying the fix and preventing regression
- Impact: Restores stable startup for all users, prevents future panics from accidental use of reserved keys
Special thanks to @d0ugal (Dougal Matthews) for identifying the root cause and providing a complete fix with thorough testing!
🚀 Major Features & Enhancements
Interactive Notification System (#1447) - Community Contribution by @cameronr
- Feature: Notification cards now clickable, navigating directly to detection details
- Implementation:
- Detection notifications link to specific detection detail pages
- Keyboard accessibility support (Enter/Space keys)
- Dynamic visual styling indicates interactive notifications
- Event propagation handling prevents accidental activation during mark-as-read/delete actions
- User Experience: Single click/tap from notification to full detection details with spectrogram, weather, and metadata
- Accessibility: Full keyboard navigation support with ARIA attributes
- Testing: Includes test notification generation with proper detection links
Special thanks to @cameronr (Cameron Ring) for this excellent UX improvement!
Detection Metadata Exposure for Notifications (#1458)
- Feature: Advanced webhook template customization with 8 new metadata fields
- Available Fields (all with
bg_prefix):bg_detection_url- Direct link to detection details pagebg_image_url- Direct link to spectrogram imagebg_confidence_percent- Formatted confidence percentage (e.g., "95")bg_detection_time- Formatted time of detectionbg_detection_date- Formatted date of detectionbg_latitude- GPS latitude (float64, 0.0 if unavailable)bg_longitude- GPS longitude (float64, 0.0 if unavailable)
- Use Cases:
- Conditional GPS coordinates in webhooks:
{{if ne .Metadata.bg_latitude 0.0}} - Confidence-based filtering in notification templates
- Rich Discord embeds with clickable links and images
- Location-aware notifications for mobile integrations
- Conditional GPS coordinates in webhooks:
- Privacy Features:
- UI warning panel when using external webhooks with GPS data
- RFC-compliant localhost/private IP detection (IPv4 RFC 1918, IPv6 RFC 4193)
- Startup warnings when localhost + external webhooks configured
- Comprehensive privacy documentation in WEBHOOK.md
- Documentation: Complete webhook guide with template safety, type handling, and privacy considerations
- Testing: 40+ test cases covering private network detection, GPS handling, and metadata validation
- Impact: Enables sophisticated notification customization while maintaining user privacy awareness
Internationalization Validation System (#1464)
- Problem: Translation coverage drift and missing translation keys causing runtime errors
- Solution: Automated validation infrastructure with two complementary validators
- Translation File Validator:
- Validates completeness across all 6 supported languages (EN, DE, FR, ES, FI, PT)
- ICU MessageFormat syntax validation
- Parameter consistency checking
- Detects empty values and untranslated strings
- LLM-friendly JSON output for automated fixes
- Usage Validator:
- Scans codebase for
t()translation usage - Finds missing translations (keys used but not defined)
- Finds unused translations (dead keys)
- Prevents runtime errors from missing keys
- Scans codebase for
- Features:
- Fast execution (< 500ms complete validation)
- GitHub Actions CI/CD integration with PR comments
- 11 new npm scripts for validation workflows
- Comprehensive 400+ line documentation
- ast-grep patterns for future advanced validation
- NPM Scripts:
npm run i18n:validate- Validate translation filesnpm run i18n:check-usage- Check code usagenpm run i18n:validate:full- Complete validationnpm run i18n:find-unused- Find dead keys
- CI/CD Integration: Automatic validation on PRs with detailed reports and artifact uploads
- Impact: Prevents translation-related runtime errors, enables confident i18n development
🐛 Bug Fixes & Performance Improvements
Complete i18n Translation Coverage (#1466)
- Achievement: 100% translation coverage across all 6 supported languages
- Fixes Applied:
- 22 missing translation keys added to en.json (keys used in code but not defined)
- 819 missing translations added across all non-English locales
- 10 ICU syntax errors resolved (placeholder keys excluded from validation)
- 12 parameter mismatch errors fixed (improved ICU parser integration)
- 52 outdated keys removed (cleanup of old OAuth, Weather Underground, test sections)
- Language Coverage (before → after):
- 🇩🇪 German (DE): 90.12% → 100% (+126 translations)
- 🇫🇷 French (FR): 90.69% → 100% (+123 translations)
- 🇪🇸 Spanish (ES): 88.30% → 100% (+148 translations)
- 🇫🇮 Finnish (FI): 88.71% → 100% (+149 translations)
- 🇧🇷 Portuguese (PT): 87.40% → 100% (+273 translations)
- Translation Quality:
- Consistent terminology within each language
- Preserved technical terms appropriately (CPU, API, MQTT)
- Proper grammar, punctuation, and accents
- Descriptive ARIA labels for accessibility
- Validator Improvements:
- Skip ICU validation for placeholder keys (contain Go template syntax examples)
- Fixed parameter extraction using ICU parser AST instead of regex
- Better error messages with proper categorization
- Impact: All UI elements now fully translated, no more missing translation warnings
Sentry Error Title Generation (#1463)
- Problem: Runtime panics appeared in Sentry with uninformative titles like
runtime.errorString: runtime error: invalid memory address or nil pointer dereference - Root Cause:
CaptureError()usedfmt.Sprintf("%T", err)which only returns Go type name - Solution: Intelligent error title parsing with three new functions
- Error Type Recognition (10+ patterns):
- Nil pointer dereference
- Index/slice out of range
- Integer divide by zero
- Send/close on closed channel
- Concurrent map access/writes
- Interface conversion failures
- Generic panics with message extraction
- Component Formatting: Automatic component name beautification
httpcontroller→HTTP Controllermedia_handler→Media Handler- Handles abbreviations (HTTP, RTSP, MQTT, API, DB)
- Examples (Before → After):
- ❌
runtime.errorString: runtime error: invalid memory address or nil pointer dereference - ✅
Media: Nil Pointer Dereference - ❌
runtime.errorString: panic: Handler.ServeHTTP panic - ✅
HTTP Controller: Panic: Handler.ServeHTTP panic - ❌
runtime.errorString: concurrent map writes - ✅
API Handler: Concurrent Map Write
- ❌
- Features:
- Added
error_titletag for filtering in Sentry - Custom fingerprints for improved error grouping
- Automatic title generation for all future panics
- Added
- Testing: 48 test cases covering all error patterns, component formatting, and real-world examples
- Impact: Clearer error identification, better grouping, more efficient debugging
Notification Metadata Consistency (#1461)
- Problem: Webhook templates using
{{.bg_detection_url}}or{{.bg_image_url}}worked for real detections but failed during API test button usage - Root Cause: Duplicate metadata enrichment code in two locations with different implementations
- Real detections: Added all 8
bg_*metadata fields - Test button: Only added basic metadata fields
- Real detections: Added all 8
- Solution: Created
EnrichWithTemplateData()helper function - Benefits:
- Single source of truth for metadata enrichment
- Test notifications now identical to real detections
- Future metadata additions easier (change in one place)
- Follows DRY (Don't Repeat Yourself) principles
- Features:
- Handles nil inputs gracefully
- Maintains fluent API pattern
- Well-documented with comprehensive godoc
- Comprehensive unit tests for edge cases
- Impact: Test button now accurately represents real notification behavior
🏗️ Infrastructure & Developer Experience
Dependency Updates
- github.com/getsentry/sentry-go: 0.36.0 → 0.36.1 (#1452)
- github.com/getsentry/sentry-go/echo: 0.36.0 → 0.36.1 (#1451)
- github.com/pkg/sftp: 1.13.9 → 1.13.10 (#1450)
- google.golang.org/api: 0.252.0 → 0.253.0 (#1449)
- github.com/nicholas-fedor/shoutrrr: 0.10.3 → 0.11.0 (#1448)
- Dependency license updates (#1453)
🎯 Developer Notes
This release focuses on stability, internationalization, and notification system enhancements. PR #1468 fixes a critical startup panic introduced in nightly-20251026, while the i18n work (#1464, #1466) brings translation coverage to 100% across all languages.
The notification improvements (#1447, #1458, #1461) provide a significantly enhanced user experience with clickable notifications, advanced webhook customization, and robust privacy controls - all while maintaining backward compatibility.
Community Highlights: Special recognition to @d0ugal and @cameronr for their excellent contributions! The logging panic fix and interactive notifications both significantly improve the user experience.
Key improvements since nightly-20251026:
- Logging panic fix - Restores stable startup for all users
- 100% translation coverage - Complete i18n for all 6 languages
- Interactive notifications - Click to navigate to detection details
- Advanced webhook metadata - 8 new template fields with privacy controls
- Automated i18n validation - Prevents future translation drift
- Better error reporting - Meaningful Sentry error titles for faster debugging
- Notification consistency - Test notifications now match production behavior
These improvements strengthen the foundation for international users, enhance the notification system, and provide better observability for debugging production issues.
Full Changelog: nightly-20251026...nightly-20251028
Contributors: Special thanks to @d0ugal (Dougal Matthews) and @cameronr (Cameron Ring) for their valuable contributions to this release!