From e4b312d136635321976e5ea9b4e0c3192eae723e Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sat, 31 Jan 2026 14:44:52 -0600 Subject: [PATCH] Enhancement: Requery channels and streams after rehashing completes --- CHANGELOG.md | 1 + frontend/src/WebSocket.jsx | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e998420a..b3dc21a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Frontend now automatically refreshes streams and channels after a stream rehash completes, ensuring the UI is always up-to-date following backend merge operations. - Frontend Unit Tests: Added comprehensive unit tests for React hooks and Zustand stores, including: - `useLocalStorage` hook tests with localStorage mocking and error handling - `useSmartLogos` hook tests for logo loading and management diff --git a/frontend/src/WebSocket.jsx b/frontend/src/WebSocket.jsx index 72bbb39a..034418f6 100644 --- a/frontend/src/WebSocket.jsx +++ b/frontend/src/WebSocket.jsx @@ -700,6 +700,17 @@ export const WebsocketProvider = ({ children }) => { withCloseButton: true, // Allow manual close loading: false, // Remove loading indicator }); + // Requery streams and channels after rehash completes + try { + await API.requeryChannels(); + await API.requeryStreams(); + await useChannelsStore.getState().fetchChannels(); + } catch (error) { + console.error( + 'Error refreshing channels/streams after rehash:', + error + ); + } } else if (parsedEvent.data.action === 'blocked') { // Handle blocked rehash attempt notifications.show({