Skip to content

[BUG]: Token-list failures appear as an empty token list #46

Description

@hrshjswniii

Bug Description

The TokenSelector component does not distinguish between a failed token-list request and a successfully loaded empty token list.

In components/TokenSelector.tsx, fetch errors are caught and the token list is replaced with an empty array:

catch (error) {
  console.error("Error fetching tokens:", error);
  setTokens([]);
}

Because of this, users may see an empty token-list state without knowing that the request failed. The manual token-address input should remain available, and the UI should show a clear error message with an option to retry.

A successful request returning HTTP 304 is expected behavior and is not the bug. The bug occurs when the token-list request fails.

Steps to Reproduce

  1. Open the Create Oracle page.
  2. Open DevTools and go to the Network tab.
  3. Enable "Disable cache".
  4. Right-click the ethereum-tokens.json request and select "Block request URL".
  5. Reload the Create Oracle page.
  6. Open the token selector.
  7. Observe the token-list state and the browser Console.

Logs and Screenshots

The normal request succeeds with:

ethereum-tokens.json    304    fetch

HTTP 304 is expected and means the browser reused its cached response.
When the request is blocked or the browser is offline, the request fails with a browser network error, such as:

net::ERR_BLOCKED_BY_CLIENT

The current code logs the failure:

Error fetching tokens: ...

Environment Details

  • OS: Windows
  • Browser: Google Chrome
  • Application: OrbOracle EVM Frontend
  • Page: Create Oracle
  • Network: Ethereum network supported by the token list
  • Reproduction method: Blocked token-list request / Offline mode

Impact

Low - Minor inconvenience

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions