From cd6f2153ce0aaad44aea2935e2d2b5763b1f561a Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 12 Feb 2026 12:47:30 -0600 Subject: [PATCH] fix: reload device stream when switching back to existing devices tab --- CHANGELOG.txt | 13 +++++++++++++ lib/towerops_web/live/device_live/index.ex | 5 +++++ priv/static/changelog.txt | 1 + 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 59584e60..cc532e51 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,19 @@ CHANGELOG - towerops-web ======================== +2026-02-12 - fix: reload device stream when switching back to existing devices tab + - File: lib/towerops_web/live/device_live/index.ex (apply_action/4) + Fixed 60-second delay when navigating from "discovered devices" tab back to "existing devices" tab. + The device stream existed in LiveView assigns from mount/3, but when the DOM element with + phx-update="stream" was removed (viewing discovered tab) and re-added (switching back), LiveView + didn't automatically re-render the stream data. Users had to wait for the next PubSub update + (device_status_changed) or periodic :tick event (every 15 seconds) to trigger reload_device_stream, + which could take 60+ seconds. + + Fix: Explicitly reload the device stream when switching to "existing" tab by calling + list_organization_devices and stream(:device_rows, build_device_rows(devices), reset: true), + matching the pattern used when loading the discovered tab. Now the table appears instantly. + 2026-02-12 - fix: suppress benign shutdown errors during K8s pod rollouts - Files: lib/towerops/honeybadger_notice_filter.ex, lib/towerops/honeybadger_filter.ex, lib/towerops/logger_filters.ex, config/config.exs, config/runtime.exs, diff --git a/lib/towerops_web/live/device_live/index.ex b/lib/towerops_web/live/device_live/index.ex index e3faa229..f8fdbb91 100644 --- a/lib/towerops_web/live/device_live/index.ex +++ b/lib/towerops_web/live/device_live/index.ex @@ -75,10 +75,15 @@ defmodule ToweropsWeb.DeviceLive.Index do }) _ -> + # Reload device stream to ensure immediate rendering when switching back to existing tab. + # Without this, the table won't appear until the next PubSub update or tick event. + devices = Devices.list_organization_devices(organization.id) + socket |> assign(:active_tab, "existing") |> assign(:discovered_devices, []) |> assign(:pagination, nil) + |> stream(:device_rows, build_device_rows(devices), reset: true) end end diff --git a/priv/static/changelog.txt b/priv/static/changelog.txt index 022e7a89..2feb37e7 100644 --- a/priv/static/changelog.txt +++ b/priv/static/changelog.txt @@ -4,6 +4,7 @@ Devices Tested & Working * Cambium ePMP 2026-02-12 +* Fixed delay when switching between device tabs * Improved stability during deployments (graceful shutdown handling) * Error reporting improvements * Performance improvements for larger deployments