Network connectivity is actively detected
Why it matters
Without active network detection, your app has no basis for deciding when to serve cached data, queue actions, or display an offline banner. Blind network calls on a disconnected device generate unhandled promise rejections that ripple into broken UI states. ISO 25010:2011 reliability.fault-tolerance requires apps to detect and respond to connection loss at runtime. The absence of a NetInfo or equivalent listener means every network-dependent feature silently fails rather than gracefully degrading — a qualitatively worse user experience than a clear offline indicator.
Severity rationale
High because without connectivity detection, all network-dependent features fail silently, leaving users with no feedback and no path to offline functionality.
Remediation
Register a NetInfo.addEventListener at app startup and store connection state in a shared hook. Every screen that needs network access reads from this hook before attempting a fetch.
// npm install @react-native-community/netinfo
import NetInfo from '@react-native-community/netinfo';
import { useEffect, useState } from 'react';
export function useNetworkStatus() {
const [isOnline, setIsOnline] = useState(true);
useEffect(() => {
const unsub = NetInfo.addEventListener(state => {
setIsOnline(state.isConnected ?? false);
});
return unsub;
}, []);
return isOnline;
}
Then gate network calls on this value and show an <OfflineBanner /> when isOnline is false. Wire this listener before your root navigator mounts so the value is stable on first render.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Mobile Offline & Storage Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.fault-tolerance — Fault Tolerance
Taxons
History
- 2026-04-18·v1.0.0·Initial import from mobile-offline-storage·automated