From 63fc09e58a5a1d120bae14917fe23279b39b682b Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 19 Mar 2026 14:29:39 -0500 Subject: [PATCH] fix check skip log noise and browser session crash (#87) - Downgrade check executor skip log from info to debug to stop flooding production logs every 60s for every agent-assigned device check - Fix KeyError on session.user_agent in settings page - BrowserSession schema has device_type field, not user_agent Reviewed-on: https://git.mcintire.me/graham/towerops-web/pulls/87 --- lib/towerops/workers/check_executor_worker.ex | 2 +- lib/towerops_web/live/user_settings_live.html.heex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/towerops/workers/check_executor_worker.ex b/lib/towerops/workers/check_executor_worker.ex index 01145ad5..605332c4 100644 --- a/lib/towerops/workers/check_executor_worker.ex +++ b/lib/towerops/workers/check_executor_worker.ex @@ -58,7 +58,7 @@ defmodule Towerops.Workers.CheckExecutorWorker do defp execute_or_skip(check) do if should_skip_check?(check) do - Logger.info("Skipping check #{check.id} (#{check.check_type}) - device has agent or Phoenix SNMP disabled") + Logger.debug("Skipping check #{check.id} (#{check.check_type}) - device has agent or Phoenix SNMP disabled") else execute_and_record(check) end diff --git a/lib/towerops_web/live/user_settings_live.html.heex b/lib/towerops_web/live/user_settings_live.html.heex index d4052051..59ba4254 100644 --- a/lib/towerops_web/live/user_settings_live.html.heex +++ b/lib/towerops_web/live/user_settings_live.html.heex @@ -898,7 +898,7 @@
  • - <%= if String.contains?(String.downcase(session.user_agent || ""), ["mobile", "android", "iphone", "ipad"]) do %> + <%= if session.device_type in ["mobile", "tablet"] do %> <.icon name="hero-device-phone-mobile" class="h-6 w-6 text-gray-400" /> <% else %> <.icon name="hero-computer-desktop" class="h-6 w-6 text-gray-400" />