Agoric / ui-kit

Components and tools for building graphical UIs
https://ui-kit-dwm.pages.dev/
Apache License 2.0
3 stars 3 forks source link

Make dapp RPC connection logic more resilient #56

Closed otoole-brendan closed 7 months ago

otoole-brendan commented 9 months ago

What is the Problem Being Solved?

When users navigate to https://app.inter.trade/ they are redirected to dapp-inter-jumper which checks for latest IPFS hash ands loads the UI. Currently, the way it works is we randomly fetch 1 of 2 RPC nodes listed in network-config and if no connection within 10seconds, we give up, throw a non-descriptive error. If you keep refreshing you might eventually hit an active RPC node. It's a poor user experience that has no resiliency and doesn't provide enough context/information to the user for them to understand what happened or what to do next.

Description of the Design

(make changes in @agoric/rpc)

  1. We try every available node once (in predetermined order).
  2. Once we’ve cycled through all RPC nodes we retry them each once.
  3. Regardless of what’s happening with node connection attempt logic, if no connection made after 5 seconds - we show ‘Connection is taking longer than expected. Please wait.’ message to user (worth giving RPC node context i.e. ‘attempting connection to Polkachu node’?)
  4. Console log messages should show error messaging
  5. Upon second retry fail - we show ‘Problem connecting to chain - this may be due to RPC connection issues. See or for more information’ please try again later.’ message to user
  6. For any other connection-related issue (i.e. all nodes not working) not defined above, use message from 5 for catch-all user error message

Security Considerations

TBD

Scaling Considerations

TBD

Test Plan