/** * Transport health tracking * * Chromium and Firefox surface `ERR_BLOCKED_BY_CLIENT` (or the equivalent * "NetworkError when attempting to fetch") to the JS layer as a generic * `TypeError: Failed to fetch` — there is no programmatic way to tell a * cancelled-by-extension request apart from an offline or DNS failure. * * What we can do is notice the pattern. Once a handful of consecutive * top-level transport failures happen in a row we treat the transport as * "likely blocked" for the rest of the page session and: * * 1. Stop scheduling new requests (no more retries, no new session * recording POSTs). The browser will keep logging * `ERR_BLOCKED_BY_CLIENT` for any request the SDK *does* fire, so * we minimise that noise by firing fewer of them. * 2. Log a single explanatory warning that points integrators at the * reverse-proxy escape hatch so they aren't left guessing. * * A subsequent successful response resets the counter — transient * connectivity glitches don't latch the SDK into "blocked" mode. * * The state is *page-session scoped*. We deliberately do not persist it * to storage: ad-blocker filter lists change, the user might disable a * blocker for our domain, and we don't want a single bad page load to * cripple every future visit. */ /** * Record a top-level transport failure (network error / blocked / aborted). * * `scope` is the SDK module reporting the failure (e.g. `"replay"`, * `"capture"`); it's used purely for the warning log message. */ export declare function markTransportFailure(scope: string): void; /** * Record a successful response. Resets the failure counter; a future run * of failures must accumulate from zero before flipping the flag again. * * Does NOT clear the `blocked` flag: once the SDK has decided to back * off in a session it stays backed off for the lifetime of that page. * Without this rule a single intermittent success between failures would * silently re-enable the retry storm we are trying to suppress. */ export declare function markTransportSuccess(): void; /** * Once the SDK believes the transport is blocked, this returns `true` * for the rest of the page session. Callers should skip scheduling work * that would otherwise spam `ERR_BLOCKED_BY_CLIENT` into the console. */ export declare function isTransportLikelyBlocked(): boolean; /** * Test-only reset. Not exported from the package barrel — only * `__tests__` should use it. */ export declare function __resetTransportHealthForTests(): void;