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).
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 intoisVerified: false, withisVerifiedErroralwaysnullsince the error never reaches react-query's error state. Downstream UI that gates issuer actions onisVerifiedwill 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
Suggested implementation
Re-throw the error instead of swallowing it to
false, so react-query'serrorstate carries it, and let the UI branch explicitly onisVerifiedErrorvs. a genuineisVerified === false.Acceptance criteria
isVerifiedError, not asisVerified: false.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).