Skip to content

Conversation

@naps62-self-hosted-claude
Copy link

Summary

  • When the ethui desktop app is unavailable, the extension now falls back to connecting to ws://localhost:8545 (standard Ethereum JSON-RPC port)
  • This allows using the extension with any local Ethereum node when ethui is not running
  • The extension periodically checks if ethui comes back online (every 5s) and automatically switches back

Changes

  • Reorganized background connection code into separate modules:
    • appConnection.ts: handles ethui app connection
    • fallbackConnection.ts: handles fallback localhost:8545 connection
  • Badge shows "F" in amber when using fallback mode
  • Popup shows a "Fallback Mode" indicator when connected via fallback
  • Connection state now tracks the source (app vs fallback)

Test plan

  • Start extension without ethui running - should connect to localhost:8545 if available
  • Start ethui while extension is using fallback - should switch back to ethui
  • Verify badge shows "F" when using fallback
  • Verify popup shows fallback indicator

Generated with Claude Code

When the ethui desktop app is unavailable, the extension now falls back
to connecting to ws://localhost:8545 (standard Ethereum JSON-RPC port).
This allows using the extension with any local Ethereum node when ethui
is not running.

Key changes:
- Reorganized background connection code into separate modules:
  - appConnection.ts: handles ethui app connection
  - fallbackConnection.ts: handles fallback localhost:8545 connection
- Extension periodically checks if ethui comes back online (every 5s)
  and automatically switches back to the main app connection
- Badge shows "F" in amber when using fallback mode
- Popup shows a fallback mode indicator when connected via fallback
- Connection state now tracks the source (app vs fallback)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove unused type exports that were flagged by ts-unused-exports:
- MessageHandler, DisconnectHandler from appConnection.ts
- ConnectionState, ConnectionSource, getConnectionSource from connectionState.ts
- MessageHandler, getFallbackEndpoint from fallbackConnection.ts
- ConnectionSource from useConnectionState.ts

Keep ConnectionState exported from useConnectionState as it's used by DisconnectedView.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants