towerops/lib/towerops_web/live
Graham McIntire 3583624e0d
fix: prevent nil boolean error in device edit page
Fixed production bug where visiting the edit page for a device with no
SNMP discovery data would crash with "expected boolean on left-side of
'and', got: nil" error.

The mikrotik_device?/1 function was using && operator which returns nil
when device.snmp_device is nil, instead of returning false. The template
conditional on line 455 requires a proper boolean value.

Changed from:
  device.snmp_device && (...)

To:
  not is_nil(device.snmp_device) and (...)

This ensures the function always returns a boolean (true/false) instead
of potentially returning nil.

Added regression test to verify the page renders correctly when a device
has no SNMP discovery data yet.

Fixes: https://app.honeybadger.io/projects/136860/faults/127120431
2026-02-03 15:32:51 -06:00
..
account_live Replace single name field with first_name and last_name 2026-02-01 15:00:23 -06:00
admin feat: migrate admin features to gettext 2026-02-02 12:45:38 -06:00
agent_live update docker compose instructions 2026-02-03 13:00:51 -06:00
alert_live feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00
device_live fix: prevent nil boolean error in device edit page 2026-02-03 15:32:51 -06:00
graph_live add mikrotik device handling 2026-02-01 16:42:39 -06:00
help_live doc update 2026-02-03 09:07:06 -06:00
mikrotik_backup_live handle mikrotik ssh 2026-02-02 16:42:18 -06:00
org add snmp port 2026-02-03 12:51:50 -06:00
org_live refactoring 2026-01-29 10:03:43 -06:00
site_live add snmp port 2026-02-03 12:51:50 -06:00
user_settings_live more gettext 2026-02-02 13:10:08 -06:00
dashboard_live.ex refactoring 2026-01-29 10:03:43 -06:00
dashboard_live.html.heex refactoring 2026-01-29 10:03:43 -06:00
mobile_qr_live.ex more dark mode 2026-01-20 17:23:11 -06:00
network_map_live.ex filter more honeybadger alerts, format dates to users time zone, email template cleanup 2026-02-01 09:27:42 -06:00
network_map_live.html.heex refactoring 2026-01-29 10:03:43 -06:00
user_registration_live.ex add snmp port 2026-02-03 12:51:50 -06:00
user_reset_password_live.ex add HIBP password check 2026-02-01 08:57:01 -06:00
user_settings_live.ex add default org 2026-02-02 10:45:37 -06:00
user_settings_live.html.heex add default org 2026-02-02 10:45:37 -06:00