{"record":{"id":"aaa0639571dd840e","repo":"Kuberwastaken/claurst","slug":"poll-bridge-messages-rate-limited-http-429-afte","errorCode":null,"errorMessage":"poll_bridge_messages: rate-limited (HTTP 429) after {} retries","messagePattern":"poll_bridge_messages: rate-limited \\(HTTP 429\\) after (.+?) retries","errorType":"http","errorClass":"anyhow::Error","httpStatus":429,"severity":"error","filePath":"src-rust/crates/bridge/src/lib.rs","lineNumber":1097,"sourceCode":"            .await\r\n            .context(\"poll_bridge_messages: HTTP GET failed\")?;\r\n\r\n        let status = resp.status().as_u16();\r\n        match status {\r\n            200 => {\r\n                let text = resp.text().await.context(\"poll_bridge_messages: reading body\")?;\r\n                if text.trim().is_empty() || text.trim() == \"[]\" {\r\n                    return Ok(vec![]);\r\n                }\r\n                let msgs: Vec<SimpleMessage> =\r\n                    serde_json::from_str(&text).context(\"poll_bridge_messages: JSON parse\")?;\r\n                return Ok(msgs);\r\n            }\r\n            204 => return Ok(vec![]),\r\n            429 => {\r\n                attempt += 1;\r\n                if attempt > max_retries {\r\n                    anyhow::bail!(\"poll_bridge_messages: rate-limited (HTTP 429) after {} retries\", max_retries);\r\n                }\r\n                let backoff = std::time::Duration::from_millis(1_000 * 2u64.pow(attempt - 1));\r\n                warn!(attempt, \"Bridge poll rate-limited; backing off {:?}\", backoff);\r\n                tokio::time::sleep(backoff).await;\r\n                continue;\r\n            }\r\n            401 | 403 => {\r\n                anyhow::bail!(\"poll_bridge_messages: auth error (HTTP {})\", status);\r\n            }\r\n            _ => {\r\n                anyhow::bail!(\"poll_bridge_messages: server returned HTTP {}\", status);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n/// Post a response to a specific incoming message on an active bridge session.\r\n///\r","sourceCodeStart":1079,"sourceCodeEnd":1115,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/bridge/src/lib.rs#L1079-L1115","documentation":"Bails after the poll loop has retried a rate-limited (HTTP 429) bridge message poll more times than max_retries allows. Each retry used exponential backoff (1s * 2^(attempt-1)); the server kept returning 429 until the retry budget was exhausted, so polling gives up rather than continue hammering the endpoint.","triggerScenarios":"Thrown at src-rust/crates/bridge/src/lib.rs:1097 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the rate-limit window to reset before restarting the bridge loop","Reduce poll frequency or number of concurrent bridge sessions to stay under the limit","If persistent, verify the account's rate-limit tier with the bridge service"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}