From 912cb8d280b0cbd53dcf71dfcf36576a05a558fc Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 5 Feb 2026 09:14:21 -0600 Subject: [PATCH] fix: add missing handle_info for state_sensors_updated in GraphLive.Show Adds handler to reload graph data when state sensors are updated via PubSub, preventing GenServer crash when viewing graph page during sensor updates. --- lib/towerops_web/live/graph_live/show.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/towerops_web/live/graph_live/show.ex b/lib/towerops_web/live/graph_live/show.ex index 4042890d..fa19322e 100644 --- a/lib/towerops_web/live/graph_live/show.ex +++ b/lib/towerops_web/live/graph_live/show.ex @@ -602,6 +602,12 @@ defmodule ToweropsWeb.GraphLive.Show do {:noreply, assign(socket, :device, device)} end + # Handle sensor updates from PubSub + @impl true + def handle_info({:state_sensors_updated, _device_id}, socket) do + {:noreply, load_graph_data(socket)} + end + # Handle live poll event @impl true def handle_info(:live_poll, socket) do