Skip to main content

Edge cases and gotchas

In plain terms: OCE is honest about ambiguity. This table is the expanded operator reference — behaviors come from the specified engine rules, not from navigator.onLine.

MDN states Navigator.onLine is unreliable and you should not disable features based on it, only hint. OCE never reads it.

CaseBehavior
Wi‑Fi associated, no internetFlag stays false until failureThreshold transport failures, then one probe. Probe fails transport → unavailable. navigator.onLine would still be true.
Captive portal returns 200 HTMLOrdinary API Responses clear the flag. Default probe also sees a Response and does not set unavailable. Opt in to 204-only for portal detection (Chrome-style).
HTTP 500 / 404Response. Flag clears. App is unhealthy, not “offline.”
Single transport blipStreak 1. No probe. unavailable stays false.
Ten parallel failuresOne probe. Streak reaches threshold once; mutex keeps streak consistent.
Success while probe in flightGeneration bumps; probe result discarded (FR-OCE-004).
User aborts request (AbortError)Streak unchanged; reportIgnored / classify ignored.
User request TimeoutErrorCounts as transport failure; increments streak.
CORS / CSP / mixed contentIndistinguishable from offline (TypeError). Use same-origin healthCheckUrl.
Service worker cache on health pathCan fake Response. Bypass cache for health URL; probe uses cache: 'no-store'.
Wrong health URL 404Default: 404 is Response → suspicion clears. 204-only mode: non-204 can confirm unavailable.
Quiet tab (no traffic)No heartbeat timer in v1. Flag stays at last observation.
Axios timeout: 0Client request not aborted. Probe still uses preset deadline; never “wait forever.”
Two remotes want different probeDeadlineHost preset wins — one engine, one probe budget.
Second bundle calls createConnectivityEngineSymbol.for singleton returns existing engine (FR-OCE-007).
Cross-origin iframeSeparate engine; cannot read parent flag.
Another browser tabSeparate engine; each tab recovers from its own traffic.
Lie-fi (TCP hang)Probe TimeoutError ends confirm; counts as failed confirm (FR-OCE-009).
opaque no-cors responseStill response — network answered.
Portal on API route onlyDefault any-Response clears flag on that traffic even when health uses 204-only.
Already unavailableattachFetch still calls baseFetch (FR-OCE-006).
Health call in flight at thresholdReuse that settlement; no duplicate health request (FR-OCE-008).
User aborts in-flight health observationAbortError ignored; engine-owned probe runs if needed.
Electron / virtual NICSame as browser: rely on fetch outcomes, not OS “connected” icons.
PWA offline shellCached shell is not reachability; health path must hit network.
Intermittent DNSTransport failures accumulate streak; recovery is next real Response.

Wi‑Fi with no upstream​

Association ≠ routing. Users see full Wi‑Fi bars while DNS or default route fails. OCE waits for transport evidence, then one shared probe — it does not trust link-local “online” heuristics (Financial Times labs note on navigator.onLine).

Captive portal nuance​

Chrome/Android detectors treat 204 or empty 200 as internet and 200 + HTML body as captive (Chromium captive portal detector). OCE defaults to any Response on the probe to favour auto-recovery. Strict portal mode is opt-in via interpretHealthResponse.

Fetch failure taxonomy​

Fetch rejects with TypeError for network, CORS, CSP, and mixed content — causes are not distinguishable in user code. That is why confirm uses a same-origin health URL.

Service worker checklist​

  1. Health probe request uses cache: 'no-store' from the engine.
  2. Worker does not respondWith cached copy for healthCheckUrl.
  3. Document the bypass in your PWA guide (PWA offline UX context).
self.addEventListener('fetch', (event) => {
const { pathname } = new URL(event.request.url);
if (pathname === '/health') return;
});

Parallel failure storm (microfrontends)​

Many remotes failing together increments streak once per settled failure at the current generation. Only crossing failureThreshold triggers one confirm. Late stale failures after recovery are ignored via generation (see Architecture).

Requirement trace refs​

IDTopic
FR-OCE-001Any Response clears without health call on that path
FR-OCE-002Below threshold — no probe
FR-OCE-003Single-flight probe at threshold
FR-OCE-004Probe discard on generation bump
FR-OCE-005Abort vs timeout classification
FR-OCE-006Non-blocking when already unavailable
FR-OCE-007Singleton identity
FR-OCE-008Reuse in-flight health URL call
FR-OCE-009Probe preset deadlines only

Sources (specified): OCE plan — gotchas table, research passes, MDN Navigator.onLine.