Problem
Dashboard traffic cards and Statistics page show "Waiting for data..." indefinitely when:
- User logs in and navigates to Dashboard
dashboardDomainReadyProvider completes before uspTrafficAnalysisProvider / uspSystemMonitorProvider are first read
- The polling providers use
ref.listen(dashboardDomainReadyProvider, ...) to start their timers
ref.listen() only fires on state changes — if the provider was already AsyncData when the listener was registered, the callback never fires
- Timer never starts → data never fetched → UI stuck on loading state
Root Cause
ref.listen(dashboardDomainReadyProvider, (_, next) {
if (next is AsyncData) {
setRefreshInterval(defaultInterval); // Never called if already AsyncData
}
});
Affected Components
UspTrafficAnalysisNotifier — Dashboard traffic card, Statistics page traffic sections
UspSystemMonitorNotifier — Dashboard system status card, Statistics page system sections
Fix
Add immediate state check after registering the listener to handle the case where the condition is already met:
final domainReady = ref.read(dashboardDomainReadyProvider);
final isAuthenticated = ref.read(appConnectionStateProvider) == AppConnectionState.authenticated;
if (domainReady is AsyncData && isAuthenticated) {
Future.microtask(() => setRefreshInterval(defaultInterval));
}
PR
#962
Problem
Dashboard traffic cards and Statistics page show "Waiting for data..." indefinitely when:
dashboardDomainReadyProvidercompletes beforeuspTrafficAnalysisProvider/uspSystemMonitorProviderare first readref.listen(dashboardDomainReadyProvider, ...)to start their timersref.listen()only fires on state changes — if the provider was alreadyAsyncDatawhen the listener was registered, the callback never firesRoot Cause
Affected Components
UspTrafficAnalysisNotifier— Dashboard traffic card, Statistics page traffic sectionsUspSystemMonitorNotifier— Dashboard system status card, Statistics page system sectionsFix
Add immediate state check after registering the listener to handle the case where the condition is already met:
PR
#962