Enterprise-Grade Offline State Manager Features: - Multi-signal detection (browser API + server ping + Network Info API) - Stability buffer (prevents flapping between online/offline) - Adaptive polling intervals - Exponential backoff with jitter
/**
* Enterprise-Grade Offline State Manager
*
* Features:
* - Multi-signal detection (browser API + server ping + Network Info API)
* - Stability buffer (prevents flapping between online/offline)
* - Adaptive polling intervals
* - Exponential backoff with jitter
* - Connection quality tracking
* - Tab visibility awareness
* - Cross-tab synchronization via BroadcastChannel
* - Captive portal detection
*
* @module utils/offline/offlineState
*/
import { logger } from "../logger";
const log = logger.create("OfflineState");
// ============================================================================
// CONFIGURATION
// ============================================================================
const CONFIG = {
// Ping settings
PING_URL: "/api/method/pos_next.api.ping",
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key