Bug report
The faults dashboard replaces itself with its first-load skeleton every time the fault list is refreshed while that list is empty. The page blinks: the header, the filters and the empty-state card disappear and come back on every refresh.
The cause is in fetchFaults. It decides "this is the initial load" from faults.length === 0, so an empty list looks the same as a list that was never loaded. Every later fetch sets isLoadingFaults again, and FaultsDashboard renders DashboardSkeleton while that flag is set and the list is empty.
A second problem shows up in the same place. FaultsDashboard and FaultsCountBadge each run their own 5 second timer and their own initial fetch, so the gateway gets two GET /faults for every refresh when both are on screen.
Steps to reproduce
- Connect to a gateway that reports no faults.
- Open the Faults Dashboard and let it load.
- Watch the page for 15 seconds, or switch to another browser tab and come back.
- Open the network tab and count the requests to
/faults.
Expected behavior
A refresh of an already loaded list leaves the page as it is. The skeleton belongs to the first load only. One refresh costs one request, no matter how many fault views are mounted.
Actual behavior
The whole dashboard is swapped for the skeleton and back on every refresh: every 5 seconds when the SSE fault stream is not delivering updates, and on every tab refocus even when it is. With the dashboard open and the sidebar badge visible, each refresh sends two requests instead of one.
Environment
- ros2_medkit_web_ui version: 0.6.0
- Browser: Chromium
- OS: Linux
Bug report
The faults dashboard replaces itself with its first-load skeleton every time the fault list is refreshed while that list is empty. The page blinks: the header, the filters and the empty-state card disappear and come back on every refresh.
The cause is in
fetchFaults. It decides "this is the initial load" fromfaults.length === 0, so an empty list looks the same as a list that was never loaded. Every later fetch setsisLoadingFaultsagain, andFaultsDashboardrendersDashboardSkeletonwhile that flag is set and the list is empty.A second problem shows up in the same place.
FaultsDashboardandFaultsCountBadgeeach run their own 5 second timer and their own initial fetch, so the gateway gets twoGET /faultsfor every refresh when both are on screen.Steps to reproduce
/faults.Expected behavior
A refresh of an already loaded list leaves the page as it is. The skeleton belongs to the first load only. One refresh costs one request, no matter how many fault views are mounted.
Actual behavior
The whole dashboard is swapped for the skeleton and back on every refresh: every 5 seconds when the SSE fault stream is not delivering updates, and on every tab refocus even when it is. With the dashboard open and the sidebar badge visible, each refresh sends two requests instead of one.
Environment