[BUG]: Profile page misclassifies RPC failures as not found or stays loading
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- next.js, react, typescript
- Domain
- backend-api-design, frontend
Research direction
Start with app/profile/page.tsx and hooks/useIdentityReads.ts, then trace how the username resolution and profile queries expose their loading, error, and data states. Add regression coverage for failed and empty query results, retries, and cached data during failed background refetches; done means failures show a retryable error state while successful empty results show “Profile not found.”
Written by the indexing model from the issue text.
Description
Bug Description
The public profile page does not properly distinguish between a profile that genuinely does not exist and a contract read that fails due to an RPC or network error.
When username resolution fails during an initial RPC request, the page can fall through to the Profile not found condition and incorrectly inform the user that no profile exists.
When navigating directly using a profile token ID (pf-...), a failed getProfile request can leave the page stuck displaying Loading profile… because the loading condition continues to evaluate as true when the token ID exists but profile data is unavailable.
Affected Files
app/profile/page.tsxhooks/useIdentityReads.ts
Actual Behavior
- Username resolution failures can cause the page to display
Profile not found, even though the profile's existence was never successfully verified. - Direct profile-token-ID navigation can remain stuck on
Loading profile…after thegetProfilerequest fails. - The page does not explicitly distinguish query failures from successful empty results in these code paths.
Expected Behavior
- A successful query returning no profile should display
Profile not found. - An RPC or network failure should display an appropriate error state instead of incorrectly claiming the profile does not exist.
- Failed initial profile reads should not leave the page stuck in an infinite loading state.
- Users should be able to retry failed requests.
- Previously cached profile data should remain visible if a background refetch fails.
Technical Details
The page currently uses the following query states:
const {
data: resolvedTokenId,
isLoading: isResolvingUsername,
} = useResolveUsername(username);
const {
data: profileData,
isLoading: isProfileLoading,
} = useProfile(profileTokenId);
The loading condition also includes:
(profileTokenId !== undefined && profileData === undefined)
This can keep the page in its loading state after a direct profile read has failed.
Additionally, the not-found condition:
if (!profileData || !profileData.name)
does not distinguish between a successful empty response and a failed contract read when the username resolution query has errored.
Suggested Solution
- Expose and handle
isErroranderrorstates from the relevant React Query hooks. - Distinguish RPC/network errors from successfully resolved nonexistent profiles.
- Prevent failed initial queries from keeping the page in an indefinite loading state.
- Provide an error state with a retry action.
- Preserve existing cached profile data during background refetch failures.
Regression Tests
- Username resolution succeeds and the profile loads.
- Username resolution successfully returns no profile.
- Username resolution fails due to an RPC/network error.
- Profile lookup succeeds for an existing profile token ID.
- Profile lookup returns empty/nonexistent profile data.
- Profile lookup fails due to an RPC/network error.
- Background refetch fails while cached profile data exists.
- A failed request recovers after retry or network restoration.
This report is based on inspection of the relevant query and rendering paths. Runtime reproduction under a deliberately failing RPC endpoint has not yet been performed.
Steps to Reproduce
Scenario 1: Username-based profile lookup
- Navigate to a public profile using a username, for example
/profile?u=username. - Simulate an RPC failure or temporary network interruption before the username resolution request completes.
- Allow the query to transition out of its initial loading state.
- Observe the page.
Scenario 2: Profile token ID lookup
- Navigate directly to a profile using its token ID, for example
/profile?u=pf-123. - Cause the initial
getProfilecontract read to fail due to an RPC or network error. - Wait for the failed query to settle.
- Observe the loading state.
Environment Details
No response
Impact
Medium - Feature works but has issues
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 20
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/IdentityTokens-EVM-Frontend
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPossibly taken @anshulchikhale30-p claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comment ·
Maintainers usually reply within 1 day
-
Contract address env overrides are ignored, breaking the documented Anvil workflowPossibly taken @anshulchikhale30-p claimed this 5 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
StabilityNexus/IdentityTokens-EVM-Frontend#171 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Use per-chain contract address maps so /claim and Anvil can run togetherPossibly taken @anshulchikhale30-p claimed this 3 days ago. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
StabilityNexus/IdentityTokens-EVM-Frontend#177 ·
Maintainers usually reply within 1 day
-
[BUG]: Dismissing transaction modals resets transaction state and may skip refresh handlingPossibly taken @Thushara3005 claimed this 2 days ago. Openbug enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
StabilityNexus/IdentityTokens-EVM-Frontend#176 · 1 comment ·
Maintainers usually reply within 1 day
All issues in StabilityNexus/IdentityTokens-EVM-Frontend
Similar issues
-
Add: GTrekkerOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Maintainers usually reply within 1 day
-
area: ui Bug Payload OSS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
payloadcms/payload#19839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
Maintainers usually reply within 1 day