{"record":{"id":"6e227dfe8244dbff","repo":"tonhowtf/omniget","slug":"baixei-os-bundles-do-x-mas-nao-achei-operacoes-graphql-neles","errorCode":null,"errorMessage":"baixei os bundles do X mas nao achei operacoes GraphQL neles","messagePattern":"baixei os bundles do X mas nao achei operacoes GraphQL neles","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/x/query_ids.rs","lineNumber":235,"sourceCode":"        tasks.push(tokio::spawn(async move {\n            let _p = sem.acquire().await.ok()?;\n            let resp = http.get(&url).send().await.ok()?;\n            if !resp.status().is_success() {\n                return None;\n            }\n            let text = resp.text().await.ok()?;\n            Some(extract_ops(&text))\n        }));\n    }\n    for t in tasks {\n        if let Ok(Some(ops)) = t.await {\n            for (op, id) in ops {\n                found.entry(op).or_insert(id);\n            }\n        }\n    }\n    if found.is_empty() {\n        anyhow::bail!(\"baixei os bundles do X mas nao achei operacoes GraphQL neles\");\n    }\n    let mut c = load();\n    for (op, id) in found {\n        c.ids.insert(op, id);\n    }\n    c.fetched_at = chrono::Utc::now().timestamp();\n    save(&c);\n    Ok(c.ids.len())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn extracts_ops_from_bundle() {\n        let js = r#\"e.exports={queryId:\"XMOz5h24KAZ86qKffKTLdQ\",operationName:\"TweetDetail\",operationType:\"query\",metadata:{}};x={operationName:\"Bookmarks\",queryId:\"iblrFnKr6PZUR-dWpfXG6g\"}\"#;\n        let ops = extract_ops(js);","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/query_ids.rs#L217-L253","documentation":"After downloading up to 60 X JS bundles and scanning them for GraphQL operation names/IDs, refresh() bails if no operations were found. The bundles downloaded fine, but none contained the expected GraphQL query IDs.","triggerScenarios":"Calling refresh() when the downloaded bundles contain no GraphQL operation definitions — usually the scripts were stripped/minified differently, or the scan regex no longer matches X's bundle output format.","commonSituations":"X changed bundle format or moved operation IDs to a manifest; downloads returned compressed content not decoded before regex scan; the 60-bundle cutoff excluded the relevant main bundle.","solutions":["Verify bundle downloads are decompressed (gzip/brotli) before running the operation-extraction regex.","Update the extraction regex for the current bundle format.","Raise/adjust the .take(60) bundle limit to include the main app bundle that holds GraphQL ops.","Fall back to the cached query-id file (load()) which may still be valid."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match refresh().await {\n    Ok(_) => (),\n    Err(e) if e.to_string().contains(\"operacoes GraphQL\") => {\n        tracing::warn!(\"refresh found no GraphQL ops; using cached ids\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Verify bundles are decompressed before regex scanning.","Track X bundle-format changes with a canary test that runs refresh periodically.","Persist fetched ids so a failed refresh does not break requests."],"tags":["scraping","regex","graphql"],"backgroundTag":"unexpected-response-shape","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"}