{"record":{"id":"68a3aa4188338952","repo":"xai-org/x-algorithm","slug":"strato-error-code","errorCode":null,"errorMessage":"Strato error code {}: {}","messagePattern":"Strato error code (.+?): (.+?)","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"visibility-filtering-client/vf_client.rs","lineNumber":183,"sourceCode":"            .map(|tweet_id| {\n                let args = vec![encode(&(*tweet_id, view.clone()))];\n                (\n                    \"visibility/service/homeMixerFilteredReason.Tweet\".to_string(),\n                    \"fetch\".to_string(),\n                    args,\n                )\n            })\n            .collect::<Vec<(String, String, Vec<Vec<u8>>)>>();\n        let result_batch = client.batch_call(calls, context.as_ref()).await;\n        let mut result_map: HashMap<u64, Result<Option<FilteredReason>>> = HashMap::new();\n        for (tweet_id, bytes_result) in tweet_ids.iter().zip(result_batch) {\n            let item_result = match bytes_result {\n                Ok(bytes) => {\n                    let decoded: StratoResult<StratoValue<FilteredReason>> = decode(&bytes);\n                    match decoded {\n                        StratoResult::Ok(strato_value) => Ok(strato_value.v),\n                        StratoResult::Err(err) => {\n                            Err(anyhow!(\"Strato error code {}: {}\", err.code, err.message))\n                        }\n                    }\n                }\n                Err(err) => Err(err),\n            };\n            result_map.insert(*tweet_id, item_result);\n        }\n        result_map\n    }\n}\n\nconst XAI_VF_DEFAULT_TIMEOUT_MS: u64 = 400;\nconst XAI_VF_MAX_BATCH_SIZE: usize = 50;\nconst XAI_VF_APERTURE_SIZE: usize = 16;\nconst VF_FILTER_TWEETS_DISCOVERY_ENV: &str = \"VF_FILTER_TWEETS_DISCOVERY\";\n\npub struct XaiVfClient {\n    client: FilterTweetsServiceClient,","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/visibility-filtering-client/vf_client.rs#L165-L201","documentation":"Raised in VF get_result when the decoded Strato result for an individual tweet is StratoResult::Err — the visibility-filtering Strato backend returned a per-item error (code + message) inside an otherwise successful batch response. The result map stores this as Err for that tweet_id while other tweets may be Ok.","triggerScenarios":"Calling filter-style VF batch lookups where one or more tweet IDs produce backend item errors: internal VF Strato errors, invalid/unsupported reason codes, or per-item processing failures.","commonSituations":"VF backend partial failures during batch filtering; specific corrupt or unsupported tweet records; VF Strato rolling out a new error code that the client surfaces verbatim.","solutions":["Inspect err.code/err.message: codes like throttle/transient warrant retrying just the failed tweet IDs","Retry only the Err entries from the result_map rather than the whole batch","If a specific code recurs, check VF service logs for that code's meaning; may indicate data-level issues","Degrade gracefully: treat per-item Err as 'unknown' (e.g. allow or conservatively filter the tweet) per product policy"],"exampleFix":"// before\nlet results = vf_client.get_result(...).await;\n\n// after\nlet results = vf_client.get_result(...).await;\nlet failed: Vec<u64> = results.iter().filter(|(_, r)| r.is_err()).map(|(id, _)| *id).collect();\nlet results = if !failed.is_empty() {\n    let mut merged = results;\n    for (id, r) in vf_client.get_result_for_ids(&failed).await { merged.insert(id, r); }\n    merged\n} else { results };","handlingStrategy":"retry","validationCode":"null","typeGuard":null,"tryCatchPattern":"let failed: Vec<u64> = map.iter().filter(|(_, r)| r.is_err()).map(|(k, _)| *k).collect(); retry only failed ids once; then degrade per policy.","preventionTips":["Handle per-item Err entries explicitly instead of failing the whole batch","Track per-code metrics for Strato item errors","Define product policy for 'unknown' filter state"],"tags":["strato","per-item-error","visibility-filtering","partial-failure","rust"],"backgroundTag":"batch-partial-item-error","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}