{"record":{"id":"f2cc22ed13f6276d","repo":"tonhowtf/omniget","slug":"syndication-api-retornou-http-mod","errorCode":null,"errorMessage":"Syndication API retornou HTTP {}","messagePattern":"Syndication API retornou HTTP (.+?)","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/twitter/mod.rs","lineNumber":460,"sourceCode":"            \"https://cdn.syndication.twimg.com/tweet-result?id={}&token={}\",\n            tweet_id, token\n        );\n\n        let mut request = self.client.get(&url);\n        if let Some(cookie) = Self::auth_cookie_string() {\n            request = request.header(\"Cookie\", cookie);\n        }\n\n        let response = request.send().await?;\n        tracing::debug!(\n            \"[twitter] syndication tweet_id={} token={} status={}\",\n            tweet_id,\n            token,\n            response.status()\n        );\n\n        if !response.status().is_success() {\n            return Err(anyhow!(\n                \"Syndication API retornou HTTP {}\",\n                response.status()\n            ));\n        }\n\n        response.json().await.map_err(Into::into)\n    }\n\n    fn extract_graphql_media(\n        json: &serde_json::Value,\n        tweet_id: &str,\n    ) -> anyhow::Result<Vec<serde_json::Value>> {\n        let instructions = json\n            .pointer(\"/data/threaded_conversation_with_injections_v2/instructions\")\n            .and_then(|v| v.as_array())\n            .ok_or_else(|| anyhow!(\"Post not available\"))?;\n\n        let add_insn = instructions","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/twitter/mod.rs#L442-L478","documentation":"request_syndication raises this error when the CDN syndication endpoint (cdn.syndication.twimg.com/tweet-result) returns any non-2xx status. The syndication API is a token-protected fallback path, so a bad status there means the fallback lookup itself failed.","triggerScenarios":"GET to the syndication tweet-result endpoint returns 404 (tweet unavailable via syndication), 403 (syndication token invalid/rejected), or 5xx (CDN/server error).","commonSituations":"calculate_syndication_token algorithm outdated after Twitter changes (403); tweet deleted/age-restricted so syndication returns 404; syndication CDN outage (5xx); rate limiting of the shared syndication endpoint.","solutions":["Log the status and verify the syndication token computation is still valid (403 usually means the token scheme changed)","Treat 404 as 'post unavailable' and fall back to the GraphQL path or vice versa","Retry 5xx with exponential backoff; syndication outages are usually transient","Update the app if Twitter changed the syndication endpoint requirements"],"exampleFix":"// before\nif !response.status().is_success() {\n    return Err(anyhow!(\"Syndication API retornou HTTP {}\", response.status()));\n}\n// after\nif !response.status().is_success() {\n    return Err(anyhow!(\"Syndication API retornou HTTP {} body={}\", response.status(),\n        response.text().await.unwrap_or_default()));\n}","handlingStrategy":"fallback","validationCode":"fn is_plausible_tweet_id(id: &str) -> bool {\n    !id.is_empty() && id.chars().all(|c| c.is_ascii_digit())\n}","typeGuard":null,"tryCatchPattern":"match request_syndication(id, &token).await {\n    Err(e) if e.to_string().starts_with(\"Syndication API retornou HTTP 5\") => {\n        request_tweet(id).await // GraphQL fallback\n    }\n    Err(e) if e.to_string().contains(\"403\") => {\n        let tok = recompute_syndication_token(id);\n        request_syndication(id, &tok).await\n    }\n    other => other,\n}","preventionTips":["Verify the syndication token scheme against current Twitter behavior when 403s spike","Always have the GraphQL path as a fallback for syndication failures","Retry 5xx with backoff — CDN errors are transient","Log the syndication status and body for diagnostics"],"tags":["http","twitter","syndication","http-status"],"backgroundTag":"api-error-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}