mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-19 16:27:37 +00:00
Implement 5 medium/low priority improvements identified in systematic review: UX IMPROVEMENTS: - Notify existing critical alerts when activating from pending_review state Previously: critical alerts during observation window would never notify Now: users receive notifications for active critical alerts after activation Implementation: Added NotifyExistingAlert() method and logic in ActivateAlerts() PERFORMANCE OPTIMIZATIONS: - Replace per-alert cleanup goroutines with periodic batch cleanup Prevents spawning 1000s of goroutines during alert flapping recentlyResolved entries now cleaned up once per minute instead of 1 goroutine per alert - Simplify GetActiveAlerts() implementation Removed intermediate map copy, holds lock slightly longer but operation is fast Cleaner code with reduced memory allocation CONFIGURATION VALIDATION: - Validate timezone in quiet hours configuration Invalid timezones now disable quiet hours with error log instead of silent fallback Prevents unexpected behavior when timezone is typo'd or invalid GRACEFUL SHUTDOWN: - Add 100ms delay in Stop() for background goroutine cleanup Reduces risk of state corruption during shutdown Allows escalation checker and periodic save to exit cleanly Technical details: - internal/alerts/alerts.go: Added NotifyExistingAlert(), optimized cleanup patterns - internal/api/alerts.go: Enhanced ActivateAlerts() to notify existing critical alerts - Removed ~20 lines of goroutine spawning code - Added periodic cleanup for recentlyResolved map - All changes preserve backward compatibility Testing: Verified compilation with 'go build -o /dev/null ./...' |
||
|---|---|---|
| .. | ||
| alerts.go | ||
| alerts_test.go | ||
| auth.go | ||
| config_handlers.go | ||
| csrf_store.go | ||
| demo_middleware.go | ||
| diagnostics.go | ||
| DO_NOT_EDIT_FRONTEND_HERE.md | ||
| docker_agents.go | ||
| frontend_embed.go | ||
| guest_metadata.go | ||
| middleware.go | ||
| notifications.go | ||
| oidc_handlers.go | ||
| oidc_service.go | ||
| rate_limit_config.go | ||
| rate_limit_config_test.go | ||
| ratelimit.go | ||
| README.md | ||
| recovery_tokens.go | ||
| router.go | ||
| router_integration_test.go | ||
| security.go | ||
| security_oidc.go | ||
| security_setup_fix.go | ||
| security_tokens.go | ||
| session_store.go | ||
| settings.go | ||
| system_settings.go | ||
| types.go | ||
| updates.go | ||
Internal API Package
This directory contains the API server implementation for Pulse.
Important Note About frontend-modern/
The frontend-modern/ subdirectory that appears here is:
- AUTO-GENERATED during builds
- NOT the source code - just a build artifact
- IN .gitignore - never committed
- REQUIRED BY GO - The embed directive needs it here
Frontend Development Location
👉 Edit frontend files at: /opt/pulse/frontend-modern/src/
Why This Structure?
Go's //go:embed directive has limitations:
- Cannot use
../paths to access parent directories - Cannot follow symbolic links
- Must embed files within the Go module
This is a known Go limitation and our structure works around it.