Skip to content

useProfile's verification check swallows all errors into false, masking real failures as "not verified" #644

Description

@K1NGD4VID

Category: Functional Edge Case

Repository location: apps/web/hooks/useProfile.ts (isVerifiedQuery, lines ~87-101)

Problem
Any failure calling the registry contract — including a transient RPC/network failure or a misconfigured registryContractID — is caught and converted into isVerified: false, with isVerifiedError always null since the error never reaches react-query's error state. Downstream UI that gates issuer actions on isVerified will incorrectly tell an already-verified user they're unverified during a network blip, with no way to distinguish "actually unverified" from "couldn't check."

Evidence

queryFn: async (): Promise<boolean> => {
  if (!address) return false;
  const client = new RegistryClient(registryContractID);
  try {
    const verified = await client.isVerified(address, address);
    return verified;
  } catch (err) {
    captureError(err);
    return false; // any error becomes "not verified"
  }
},

Suggested implementation
Re-throw the error instead of swallowing it to false, so react-query's error state carries it, and let the UI branch explicitly on isVerifiedError vs. a genuine isVerified === false.

Acceptance criteria

  • A simulated RPC failure during the verification check surfaces via isVerifiedError, not as isVerified: false.
  • The UI shows a distinct "couldn't verify status, try again" state instead of "not verified" when the check itself fails.

Difficulty: Easy

Expected impact: Prevents legitimately verified issuers from being incorrectly blocked from issuer actions during transient failures.


Filed as part of the second repository-wide audit (deeper refinements following the first cleanup pass).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendNext.js Web Application

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions