diff --git a/CHANGELOG.txt b/CHANGELOG.txt index af4588b0..cb16688b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,31 @@ +2026-03-05 +fix: comprehensive reliability audit bug fixes (16 bugs fixed) + - Critical (5): Task.yield_many race condition, Enum.zip data corruption, missing Alert schema fields, LiveView timer/PubSub leaks + - High (3): clock skew handling, nil crash in interface status, migration index naming + - Medium (6): race conditions, error handling, notification failures, state bleeding + - Infrastructure: health check log silencing, catch-all handle_info callbacks +Files: lib/towerops/workers/device_poller_worker.ex, device_monitor_worker.ex, snmp/profiles/base.ex, alerts/alert.ex, devices.ex + lib/towerops_web/live/mobile_qr_live.ex, activity_feed_live.ex, agent_live/index.ex, device_live/form.ex, device_live/index.ex + lib/towerops_web/channels/agent_channel.ex, plugs/filter_noisy_logs.ex + priv/repo/migrations/20260305144327_fix_equipment_indexes_after_rename.exs +Details: + - Fixed Task.yield_many returning fewer results than expected, causing silent data corruption + - Fixed Enum.zip in SNMP base profile truncating values when SNMP returns incomplete data + - Updated Alert schema with missing fields: check_id, severity, notification_sent, notification_sent_at, output + - Fixed memory leaks from uncancelled timers in 4 LiveViews (mobile_qr, activity_feed, agent_live) + - Fixed PubSub subscription leak in device form credential testing + - Fixed clock skew bug in needs_discovery? causing incorrect behavior with future timestamps + - Fixed nil crash in interface status display with proper nil handling + - Created migration to fix index names missed during equipment→devices table rename + - Fixed race condition in device monitor worker (duplicate maintenance checks, pattern match crashes) + - Added preload validation guard in devices.ex get_org_default_agent + - Improved error handling in alerts.ex (specific rescue clauses with logging) + - Added error logging to fire-and-forget notification tasks + - Fixed LiveView state bleeding between tabs (assign_new → assign) + - Silenced health check endpoint logs (/health, /health/time) to reduce log noise + - Added catch-all handle_info callbacks to prevent crashes from unexpected messages + - Added error checking for sensor reading batch inserts + 2026-02-13 refactor: zero credo strict issues — fix all warnings, readability, nesting, aliases fix: broken route paths in dashboard and insights templates diff --git a/lib/towerops/workers/device_poller_worker.ex b/lib/towerops/workers/device_poller_worker.ex index 1e23961c..74f06f05 100644 --- a/lib/towerops/workers/device_poller_worker.ex +++ b/lib/towerops/workers/device_poller_worker.ex @@ -689,7 +689,19 @@ defmodule Towerops.Workers.DevicePollerWorker do end) # Batch insert all sensor readings - Snmp.create_sensor_readings_batch(reading_entries) + case Snmp.create_sensor_readings_batch(reading_entries) do + {:ok, _count} -> + :ok + + {:error, reason} -> + require Logger + + Logger.error( + "Failed to batch insert sensor readings: #{inspect(reason)}", + count: length(reading_entries), + error: reason + ) + end # Process metadata updates and change detection individually Enum.each(poll_results, fn {sensor, result} -> diff --git a/priv/static/changelog.txt b/priv/static/changelog.txt index c742c359..fd3aa548 100644 --- a/priv/static/changelog.txt +++ b/priv/static/changelog.txt @@ -1,3 +1,12 @@ +2026-03-05 — Reliability & Performance Improvements +* Fixed memory leaks in real-time dashboard components +* Improved error handling for device polling and monitoring +* Better handling of clock synchronization issues between servers +* Fixed data corruption issues in SNMP polling +* Reduced log noise from health check endpoints +* Enhanced stability for alert notifications +* Improved handling of network timeouts and failures + 2026-02-13 — Navigation & Visual Polish * Breadcrumb navigation on device detail, site detail, config timeline, and trace pages * Loading skeleton placeholders while data loads on the dashboard