fix: reload device stream when switching back to existing devices tab

This commit is contained in:
Graham McIntire 2026-02-12 12:47:30 -06:00
parent 3abcbebdd9
commit cd6f2153ce
No known key found for this signature in database
3 changed files with 19 additions and 0 deletions

View file

@ -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,

View file

@ -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

View file

@ -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