{"record":{"id":"95a0a3aaf1bbdc27","repo":"CloakHQ/CloakBrowser","slug":"timeout","errorCode":"timeout","errorMessage":"timeout","messagePattern":"timeout","errorType":"error_code","errorClass":"ActionabilityError","httpStatus":null,"severity":"error","filePath":"dotnet/src/CloakBrowser/Human/Actionability.cs","lineNumber":158,"sourceCode":"        IsolatedWorld? stealth = null)\n    {\n        if (force)\n            return;\n        if (stealth == null)\n            throw new StealthWorldUnavailableError();\n\n        double deadline = NowMs() + timeoutMs;\n        int attempt = 0;\n        Exception? lastError = null;\n\n        while (true)\n        {\n            double remainingMs = Math.Max(0, deadline - NowMs());\n            if (remainingMs <= 0)\n            {\n                if (lastError != null)\n                    throw lastError;\n                throw new ActionabilityError(selector, \"timeout\", \"timeout expired before first check\");\n            }\n\n            try\n            {\n                var (status, snapshot) = await StealthDom.ActionableAsync(\n                    stealth, selector).ConfigureAwait(false);\n                if (status == StealthStatus.Unsupported)\n                    throw new UnsupportedHumanizeSelectorError(selector);\n                if (status == StealthStatus.EvaluationFailed)\n                    throw new StealthEvaluationError(selector);\n                if (status == StealthStatus.NotFound)\n                    throw new ElementNotAttachedError(selector);\n                if (status != StealthStatus.Ok || snapshot == null)\n                    throw new StealthEvaluationError(selector);\n\n                var value = snapshot.Value;\n                if (checks.Contains(\"visible\") && !value.Visible)\n                    throw new ElementNotVisibleError(selector);","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/dotnet/src/CloakBrowser/Human/Actionability.cs#L140-L176","documentation":"The actionability polling loop in EnsureActionableAsync ran out of time before even one DOM check completed, and no earlier element error was recorded to rethrow. It means the deadline elapsed with zero successful StealthDom.ActionableAsync evaluations — the element state was never assessed.","triggerScenarios":"Calling EnsureActionableAsync with a timeoutMs too small for even one round-trip to the isolated world (remainingMs <= 0 on the first iteration with lastError == null), or the browser/CDP connection being so slow the first check never completes.","commonSituations":"Passing timeoutMs of 0 or a few milliseconds; overloaded browser or CPU-starved worker making the first CDP evaluation exceed the budget; navigating while the check starts; unit tests with artificially tiny timeouts.","solutions":["Increase timeoutMs to a realistic value (hundreds of ms to seconds).","Ensure the page is settled (not navigating) before starting actionability checks.","Profile the isolated-world round-trip time; if it routinely exceeds the timeout, fix browser performance or headless-mode issues.","If an earlier element error exists it is rethrown instead — address that underlying error first."],"exampleFix":"// before\nawait Actionability.EnsureActionableAsync(page, selector, stealth, timeoutMs: 5);\n\n// after\nawait Actionability.EnsureActionableAsync(page, selector, stealth, timeoutMs: 5000);","handlingStrategy":"retry","validationCode":"if (timeoutMs < 250) throw new ArgumentOutOfRangeException(nameof(timeoutMs), \"allow at least one DOM round-trip\");","typeGuard":null,"tryCatchPattern":"catch (ActionabilityError ex) when (ex.Code == \"timeout\")\n{\n    await Task.Delay(200);\n    await Actionability.EnsureActionableAsync(page, selector, stealth, timeoutMs: Math.Max(timeoutMs * 4, 5000));\n}","preventionTips":["Never pass near-zero timeouts; budget >= 1s for the first isolated-world round-trip.","Ensure the page is idle before starting actionability polling.","Warm up the isolated world once per page to avoid first-evaluation latency."],"tags":["actionability","timeout","polling","cdp"],"backgroundTag":"operation-timed-out","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}