{"record":{"id":"8eecc0269d9cfcdd","repo":"tonhowtf/omniget","slug":"tipo-desconhecido","errorCode":null,"errorMessage":"tipo desconhecido: {}","messagePattern":"tipo desconhecido: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/instagram/publish.rs","lineNumber":527,"sourceCode":"                    children.push(serde_json::json!({\"upload_id\": uid, \"source_type\": \"library\"}));\n                }\n                super::sleep_jitter(500, 1500).await;\n            }\n            report(\"configure\", total - 1, total);\n            let mut form = common_form(req, &sidecar_id);\n            form.push((\"client_sidecar_id\", sidecar_id.clone()));\n            form.push((\n                \"children_metadata\",\n                serde_json::to_string(&children).unwrap_or_default(),\n            ));\n            let json = client\n                .post_form(\"/api/v1/media/configure_sidecar/\", &form)\n                .await\n                .map_err(m)?;\n            report(\"done\", total, total);\n            Ok(result_of(&json))\n        }\n        other => Err(anyhow!(\"tipo desconhecido: {}\", other)),\n    }\n}\n\n// ── API oficial (Graph) ──────────────────────────────────────────────────\n\n#[derive(Debug, Clone, Serialize, Deserialize, Default)]\npub struct GraphAuth {\n    pub access_token: String,\n    pub ig_user_id: String,\n}\n\nconst GRAPH: &str = \"https://graph.facebook.com/v21.0\";\n\nasync fn graph_post(\n    http: &reqwest::Client,\n    url: &str,\n    form: &[(&str, String)],\n) -> anyhow::Result<Value> {","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/instagram/publish.rs#L509-L545","documentation":"publish_web dispatches on a media type tag and only handles the known variants (e.g. single image, video, sidecar/carousel). If the request carries a type string that does not match any implemented branch, the fallthrough arm rejects it with \"tipo desconhecido: <type>\". It is an internal/forward-compatibility guard: the type value was either typoed, newly added, or produced by a caller not synchronized with this switch.","triggerScenarios":"Calling publish_web (publish_web entry in src-tauri/omniget-core/src/core/tools/instagram/publish.rs) with a PublishRequest whose media type string is not one of the explicitly matched variants — e.g. type=\"reel\" or \"story\" when only \"image\"/\"video\"/\"sidecar\" are implemented, or an empty/unset type.","commonSituations":"Frontend sends a new media kind the Rust backend has not implemented yet; typo in the type field; deserialization defaults the type field when JSON omits it; version mismatch between app frontend and bundled core.","solutions":["Check the type value in the PublishRequest against the variants matched in publish_web's match expression and use one of the supported ones","Add a new arm to the match in publish_web implementing the missing media type, or map it to an existing one","Log/serialize the full request on failure to confirm what type string actually arrived (whitespace/case differences)"],"exampleFix":"// before\nlet req = PublishRequest { media_type: \"reel\".into(), .. };\npublish_web(&req).await?; // Err: tipo desconhecido: reel\n// after\nlet req = PublishRequest { media_type: \"video\".into(), .. };\npublish_web(&req).await?;","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\"image\", \"video\", \"sidecar\"];\nif !SUPPORTED.contains(&req.media_type.as_str()) {\n    return Err(format!(\"tipo de mídia não suportado: {}\", req.media_type));\n}","typeGuard":"fn is_supported_media_type(t: &str) -> bool {\n    matches!(t, \"image\" | \"video\" | \"sidecar\")\n}","tryCatchPattern":null,"preventionTips":["Model media type as an enum with serde instead of a free-form string","Keep frontend media-type constants in sync with the Rust match arms","Log the rejected type value so mismatches are diagnosable"],"tags":["instagram","unsupported-operation","rust"],"backgroundTag":"invalid-enum-value","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"}