towerops/lib/towerops_web
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
..
channels fix: resolve MikroTik sensor values and empty SNMP communities 2026-02-02 17:12:36 -06:00
components feat: migrate core components to gettext 2026-02-02 12:49:13 -06:00
controllers add snmp port 2026-02-03 12:51:50 -06:00
helpers Mikrotik backup and gettext start 2026-02-02 09:11:22 -06:00
live fix: prevent nil boolean error in device edit page 2026-02-03 15:32:51 -06:00
plugs Add rate limiting to auth and API endpoints using Hammer 2026-02-01 14:59:54 -06:00
endpoint.ex Move CaptureTimezone plug to browser pipeline 2026-02-01 11:15:51 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
gettext_helpers.ex feat: migrate email templates to gettext (Phase 2 - Emails) 2026-02-02 09:48:30 -06:00
permissions.ex handle mikrotik ssh 2026-02-02 16:42:18 -06:00
router.ex Mikrotik backup and gettext start 2026-02-02 09:11:22 -06:00
telemetry.ex fix: add Oban config to dev.exs and replace Exq telemetry with Oban 2026-01-24 16:39:45 -06:00
user_auth.ex feat: migrate all remaining authentication and session flash messages to gettext 2026-02-02 13:02:44 -06:00