Skip to content

Conversation

@alejandralevy
Copy link
Contributor

@alejandralevy alejandralevy commented Feb 10, 2026

ENS Infinite Loader Fix

Accessing non-existent ENS names showed infinite spinner instead of error message.

Changes

1. Redux State - Separate Error Field

src/modules/ens/reducer.ts

  • Added fetchNameError: ENSError | null to ENSState
  • FETCH_ENS_REQUEST clears both error and fetchNameError
  • FETCH_ENS_FAILURE sets both error and fetchNameError
  • Other requests (list, external) only clear general error, preserving
    fetchNameError

2. Selectors - New Error Selector

src/modules/ens/selectors.ts

export const getFetchNameError = (state: RootState) => getState(state).fetchNameError
export const getFetchNameErrorMessage = (state: RootState) => {
  const error = getFetchNameError(state)
  return error ? error.message : null
}

3. Container - Use Isolated Error

  src/components/ENSDetailPage/ENSDetailPage.container.tsx
  // BEFORE: getErrorMessage (shared error)
  // AFTER:  getFetchNameErrorMessage (isolated error)
  const error = useSelector(getFetchNameErrorMessage)

4. Shared Empty State Component

src/components/ENSEmptyState/

  • Created reusable ENSEmptyState component
  • Used in ENSDetailPage and ENSListPage
  • Removed duplicated CSS from ENSListPage

5. Tests

src/modules/ens/reducer.spec.ts

  • Added tests for FETCH_ENS_REQUEST (clears both errors)
  • Added tests for FETCH_ENS_FAILURE (sets both errors)
  • Added tests for FETCH_ENS_LIST_REQUEST (only clears general error)
video.mov
Screen.Recording.2026-02-11.at.11.30.47.mov

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
builder Ready Ready Preview, Comment Feb 11, 2026 11:05am

Request Review

@coveralls
Copy link

coveralls commented Feb 10, 2026

Pull Request Test Coverage Report for Build 21902527070

Details

  • 6 of 22 (27.27%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 49.174%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/modules/ens/selectors.ts 2 6 33.33%
src/modules/ens/sagas.ts 0 12 0.0%
Files with Coverage Reduction New Missed Lines %
src/modules/ens/sagas.ts 1 36.7%
Totals Coverage Status
Change from base Build 21685881015: 0.04%
Covered Lines: 6273
Relevant Lines: 11643

💛 - Coveralls

Copy link
Member

@RocioCM RocioCM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfect when the name doen't exist, but should we handle the case where the name exists but you are not the owner?

Screen.Recording.2026-02-10.at.10.02.18.AM.mov

Comment on lines 133 to 142
export const getFetchNameError = (state: RootState) => getState(state).fetchNameError

export const getFetchNameErrorMessage = (state: RootState) => {
const error = getFetchNameError(state)
if (error) {
return error.message
}

return null
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getFetch... sounds weird. maybe we can just change the prop in the slice to something simpler so this getter is easier to name 🚀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to ensError

@alejandralevy alejandralevy changed the title feat: Show empty state when name does not exist feat: Show not found name when trying to see unexisting or not owned name Feb 10, 2026
) : null}
</span>
<LoggedInDetailPage activeTab={NavigationTab.NAMES} isPageFullscreen={true} isLoading={isLoading}>
{!isLoading && error ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{!isLoading && error ? (
{!isLoading && (error || !ens) ? (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a validation 2 lines down to check that there's an ens before showing the info. If I add that validation there, it creates a glitch on the UI because ens is undefined at the beggining

ui.bug.mov

...state,
loading: loadingReducer(state.loading, action),
error: { ...action.payload.error },
fetchNameError: { ...action.payload.error }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can continue using error for this case

Suggested change
fetchNameError: { ...action.payload.error }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to ensError

Comment on lines 133 to 142
export const getFetchNameError = (state: RootState) => getState(state).fetchNameError

export const getFetchNameErrorMessage = (state: RootState) => {
const error = getFetchNameError(state)
if (error) {
return error.message
}

return null
}
Copy link
Member

@cyaiox cyaiox Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to the reducer comment, I think you can continue using getErrorMessage

Suggested change
export const getFetchNameError = (state: RootState) => getState(state).fetchNameError
export const getFetchNameErrorMessage = (state: RootState) => {
const error = getFetchNameError(state)
if (error) {
return error.message
}
return null
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to ensError

return {
...state,
loading: loadingReducer(state.loading, action),
error: { ...action.payload.error },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: { ...action.payload.error },

case FETCH_ENS_REQUEST: {
return {
...state,
error: null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: null,

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants