tonhowtf/omniget · error · anyhow::Error

baixei os bundles do X mas nao achei operacoes GraphQL neles

Error message

baixei os bundles do X mas nao achei operacoes GraphQL neles

What it means

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.

Solutions

  1. Verify bundle downloads are decompressed (gzip/brotli) before running the operation-extraction regex.
  2. Update the extraction regex for the current bundle format.
  3. Raise/adjust the .take(60) bundle limit to include the main app bundle that holds GraphQL ops.
  4. Fall back to the cached query-id file (load()) which may still be valid.
Defensive patterns

Strategy: fallback

Try / catch

match refresh().await {
    Ok(_) => (),
    Err(e) if e.to_string().contains("operacoes GraphQL") => {
        tracing::warn!("refresh found no GraphQL ops; using cached ids");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/6e227dfe8244dbff. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/x/query_ids.rs:235

        tasks.push(tokio::spawn(async move {
            let _p = sem.acquire().await.ok()?;
            let resp = http.get(&url).send().await.ok()?;
            if !resp.status().is_success() {
                return None;
            }
            let text = resp.text().await.ok()?;
            Some(extract_ops(&text))
        }));
    }
    for t in tasks {
        if let Ok(Some(ops)) = t.await {
            for (op, id) in ops {
                found.entry(op).or_insert(id);
            }
        }
    }
    if found.is_empty() {
        anyhow::bail!("baixei os bundles do X mas nao achei operacoes GraphQL neles");
    }
    let mut c = load();
    for (op, id) in found {
        c.ids.insert(op, id);
    }
    c.fetched_at = chrono::Utc::now().timestamp();
    save(&c);
    Ok(c.ids.len())
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn extracts_ops_from_bundle() {
        let js = r#"e.exports={queryId:"XMOz5h24KAZ86qKffKTLdQ",operationName:"TweetDetail",operationType:"query",metadata:{}};x={operationName:"Bookmarks",queryId:"iblrFnKr6PZUR-dWpfXG6g"}"#;
        let ops = extract_ops(js);

View on GitHub (pinned to 8600b91f42)