{"record":{"id":"a81f86bdf93a76a7","repo":"xai-org/x-algorithm","slug":"ttl-1","errorCode":null,"errorMessage":"ttl=-1","messagePattern":"ttl=-1","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"thunder/strato_client.rs","lineNumber":139,"sourceCode":"        if !response.status().is_success() {\n            metrics::STRATO_REQUESTS\n                .with_label_values(&[\"fetch_following_list\", \"error\"])\n                .inc();\n            warn!(\n                \"Following list fetch failed for {}: {}\",\n                user_id,\n                response.status()\n            );\n            return Err(anyhow!(response.status().to_string()));\n        }\n\n        let text = response.text().await?;\n\n        if text == \"{\\\"ttl\\\":-1}\" {\n            metrics::STRATO_REQUESTS\n                .with_label_values(&[\"fetch_following_list\", \"not_found\"])\n                .inc();\n            return Err(anyhow!(\"ttl=-1\"));\n        }\n\n        match serde_json::from_str::<StratoResponse<Vec<String>>>(&text) {\n            Ok(result) => {\n                metrics::STRATO_REQUESTS\n                    .with_label_values(&[\"fetch_following_list\", \"success\"])\n                    .inc();\n                Ok(result.v)\n            }\n            Err(e) => {\n                metrics::STRATO_REQUESTS\n                    .with_label_values(&[\"fetch_following_list\", \"parse_error\"])\n                    .inc();\n                warn!(\n                    \"Failed to parse following list response for {}: {}. Response preview: {}\",\n                    user_id,\n                    e,\n                    &text[..text.len().min(300)]","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/thunder/strato_client.rs#L121-L157","documentation":"Returned by fetch_following_list_internal when the Strato response body is exactly {\"ttl\":-1}. That is Strato's sentinel meaning the user has no following list (not found / no data), reported via the not_found metric label. It's an error-shaped signal for a semantically empty result.","triggerScenarios":"Calling fetch_following_list for a user with no following data in Strato — new/suspended/deleted accounts or users whose following list was never materialized.","commonSituations":"Bots or brand-new accounts with no following; deleted/suspended users; lookups racing account deletion; tests using nonexistent user ids.","solutions":["Treat ttl=-1 as an empty list rather than propagating the error: catch this specific message and return an empty Vec or None","If the caller distinguishes 'no data' from 'error', map this to an Option<Vec<String>>::None result","Do not retry — this is a deterministic Strato signal, not a transient failure","Log/metric it separately from real fetch failures to avoid alert noise"],"exampleFix":"// before\n// caller:\nlet following = client.fetch_following_list(user_id).await?;\n\n// after\nlet following = match client.fetch_following_list(user_id).await {\n    Ok(f) => f,\n    Err(e) if e.to_string().contains(\"ttl=-1\") => Vec::new(), // no following list\n    Err(e) => return Err(e),\n};","handlingStrategy":"fallback","validationCode":"null","typeGuard":"fn is_no_following_list(e: &anyhow::Error) -> bool { e.to_string() == \"ttl=-1\" }","tryCatchPattern":"match client.fetch_following_list(u).await { Ok(f) => f, Err(e) if is_no_following_list(&e) => Vec::new(), Err(e) => Err(e) }","preventionTips":["Never alert on ttl=-1; exclude it from error metrics","Treat the sentinel as 'no data', not a failure"],"tags":["strato","not-found","sentinel-response","social-graph","rust"],"backgroundTag":"api-not-found-sentinel","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}