Skip to content

fix(alerts): harden with security fixes, design compliance, and test coverage#570

Merged
AnsoCode merged 2 commits into
mainfrom
fix/alerts-hardening
Apr 14, 2026
Merged

fix(alerts): harden with security fixes, design compliance, and test coverage#570
AnsoCode merged 2 commits into
mainfrom
fix/alerts-hardening

Conversation

@AnsoCode

Copy link
Copy Markdown
Collaborator

Summary

  • Add authMiddleware to all alert endpoints (GET/POST/DELETE /api/alerts) that were previously unprotected
  • Validate notification test dispatch inputs (type must be discord/slack/webhook, URL must be HTTPS)
  • Fix restart_count metric that was hardcoded to 0; now fetches via Docker inspect API
  • Correct network metric unit labels from MB/s to MB (cumulative, not rate)
  • Replace any types on Docker stats calculation methods with proper DockerContainerStats interface
  • Add 10-second timeout (AbortSignal.timeout) to all webhook fetch calls
  • Track and persist dispatch errors to notification history records
  • Add update availability notifications: Sencho version updates (6-hour check in MonitorService) and stack image updates (state transition detection in ImageUpdateService)
  • Extract shared version fetch logic from index.ts into utils/version-check.ts
  • Frontend: migrate Select to Combobox, add ScrollArea, add delete confirmation AlertDialog, fix icon strokeWidth
  • Add diagnostic logging gated behind developer_mode for MonitorService and NotificationService
  • 24 new alert API integration tests + restart_count and version check unit tests (688 total passing)
  • Update docs with HTTPS requirement, update notifications section, and troubleshooting guide

Test plan

  • Backend TypeScript compiles clean (tsc --noEmit)
  • Frontend TypeScript compiles clean (tsc --noEmit)
  • All 688 backend tests pass (npm test)
  • Manual: verify alert endpoints reject unauthenticated requests
  • Manual: verify Combobox dropdowns work in alert sheet
  • Manual: verify delete confirmation dialog appears before removing a rule
  • Manual: verify ScrollArea scrolls correctly in the alert sheet

…coverage

Add authMiddleware to all alert endpoints, validate notification test
dispatch inputs, fix restart_count metric via Docker inspect, correct
network metric units, replace any types with DockerContainerStats
interface, add webhook timeouts and dispatch error tracking.

Frontend: migrate Select to Combobox, add ScrollArea and delete
confirmation AlertDialog, fix icon strokeWidth to 1.5.

Add update availability notifications for both Sencho version updates
(6-hour check in MonitorService) and stack image updates (state
transition detection in ImageUpdateService). Extract shared version
fetch logic into utils/version-check.ts.

Add diagnostic logging gated behind developer_mode for MonitorService
breach state machine and NotificationService dispatch routing.

Tests: 24 new alert API integration tests, restart_count and version
check unit tests (688 total passing). Docs updated with HTTPS
requirement, update notifications section, and troubleshooting guide.
@AnsoCode
AnsoCode merged commit 0a94df3 into main Apr 14, 2026
6 checks passed
@AnsoCode
AnsoCode deleted the fix/alerts-hardening branch April 14, 2026 01:40
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