tonhowtf/omniget · warning

perfil indisponivel

Error message

perfil indisponivel

What it means

profile() fetched the FxTwitter profile endpoint but the response contained no "user" object to convert with user_from, yielding 'perfil indisponivel'. This is a missing-field failure on a successful request, distinct from the 404/401 cases handled inside get().

Solutions

  1. Verify the handle exists (open x.com/<handle> in a browser).
  2. Retry — newly created accounts may appear after a delay.
  3. Fall back to the native XClient profile fetch.
  4. If valid profiles fail consistently, check FxTwitter's API for schema changes and update user_from.

Example fix

// before
let v = get(&format!("profile/{}", handle), &[]).await?;
v.get("user").map(user_from).ok_or_else(|| anyhow!("perfil indisponivel"))
// after
let v = get(&format!("profile/{}", handle), &[]).await?;
match v.get("user").map(user_from) {
    Some(u) => Ok(u),
    None => xclient::profile(handle).await,
}
Defensive patterns

Strategy: fallback

Validate before calling

// regex de handle antes de chamar
let re = regex::Regex::new(r"^@?[A-Za-z0-9_]{1,15}$").unwrap();
if !re.is_match(handle) { return Err(anyhow!("handle invalido: {handle}")); }

Type guard

fn has_user(v: &Value) -> bool {
    v.get("user").map_or(false, |u| u.get("screen_name").is_some())
}

Try / catch

match fx::profile(&handle).await {
    Ok(u) => u,
    Err(e) if e.to_string().contains("perfil indisponivel") => {
        xclient::profile(&handle).await.map_err(|_| anyhow!("perfil {handle} indisponivel"))?
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: FxTwitter returns an envelope without a user field for a handle — suspended or shadow-banned account, brand-new account not yet indexed, or a schema change in FxTwitter's profile response.

Common situations: Requesting a recently created or suspended profile; handles with unusual casing that resolve oddly; FxTwitter degrading profile data during incidents.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/x/fx.rs:362

    .await?;
    let items = v
        .get("replies")
        .and_then(|a| a.as_array())
        .into_iter()
        .flatten()
        .filter_map(post_from)
        .collect();
    Ok(Page {
        items,
        cursor: bottom_cursor(&v),
    })
}

pub async fn profile(handle: &str) -> anyhow::Result<XUser> {
    let v = get(&format!("profile/{}", handle), &[]).await?;
    v.get("user")
        .map(user_from)
        .ok_or_else(|| anyhow!("perfil indisponivel"))
}

pub async fn profile_statuses(
    handle: &str,
    cursor: Option<&str>,
    with_replies: bool,
) -> anyhow::Result<Page<XPost>> {
    let v = get(
        &format!("profile/{}/statuses", handle),
        &[
            ("cursor", cursor.unwrap_or("").to_string()),
            ("count", "100".to_string()),
            (
                "with_replies",
                if with_replies {
                    "true".to_string()
                } else {
                    String::new()

View on GitHub (pinned to 8600b91f42)