towerops/CHANGELOG.txt
Graham McIntire 45357e334a
fix live polling to use effective agent from site/org cascade
live poll mode used get_device_assignment which only checks direct
device-level assignments. devices with agent assigned at site or
org level fell through to direct Phoenix SNMP. replaced with
get_effective_agent_token which walks the full cascade.
2026-02-11 14:12:42 -06:00

37 lines
2.3 KiB
Text

CHANGELOG - towerops-web
========================
2026-02-11 - fix: live polling uses effective agent from site/org cascade
- File: lib/towerops_web/live/graph_live/show.ex
- Bug: Live poll mode used Agents.get_device_assignment/1 which only checks
direct device-level assignments. Devices with agent assigned at site or
org level fell through to direct Phoenix SNMP instead of routing to agent.
- Fix: Replaced with Agents.get_effective_agent_token/1 which walks the
device → site → org cascade, matching how regular polling resolves agents.
Also simplified request_agent_live_poll_and_wait to accept token_id directly.
2026-02-11 - fix: round sensor values to 1 decimal place
- Files: lib/towerops/workers/device_poller_worker.ex (poll_simple_sensor/2),
lib/towerops_web/channels/agent_channel.ex (process_sensor_reading/3)
- Bug: Division by sensor_divisor produced full float precision (e.g. 34.09999999)
- Fix: Wrap division result with Float.round(..., 1) in both Phoenix and agent paths
2026-02-11 - fix: update device status from agent monitoring checks
- File: lib/towerops_web/channels/agent_channel.ex (store_monitoring_check/2)
- Bug: Devices polled by remote agents stayed in "unknown" state because
store_monitoring_check saved the ping result but never called
Devices.update_device_status/2. The DeviceMonitorWorker (Phoenix-side)
skips agent-assigned devices entirely, so nothing ever updated status.
- Fix: Added update_device_status_from_check/2 and handle_agent_status_change/3
to derive :up/:down from check status, update device, create alerts on
transitions, and broadcast via PubSub — matching DeviceMonitorWorker behavior
- Also added alias Towerops.Alerts to the channel module
2026-02-11 - fix: update last_snmp_poll_at for agent-polled devices
- File: lib/towerops_web/channels/agent_channel.ex (process_polling_result/3)
- Bug: Devices polled by remote agents showed "Last Polled: Never" because
process_polling_result never called Devices.update_snmp_poll_time/1
- The Phoenix-side DevicePollerWorker already had this call (line 172),
but the agent channel path was missing it
- Fix: Added Devices.update_snmp_poll_time(device) at the top of
process_polling_result/3, matching the DevicePollerWorker pattern