Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Errors, Network requests and no internet connection

Tobias Schubotz edited this page Jun 29, 2020 · 2 revisions

Context

We fetch different data from our backend and the blockchain. We should ensure that both clients behave similarly, if not the same. e.g. in the legacy mobile app, iOS had some kind of polling whereas Android only refreshed when accessing a screen. This should be prevented.

Questions to answer

  • When do we expect clients to make network requests?
  • What happens when there is no response or no internet connection?
  • How real time should we update information?
  • How do we display errors

Where do we do network requests?

  • Assets
    • Load balances (ETH, ERC20, Collectibles)
  • Transactions
    • Load transactions list
    • Load creation tx (Perhaps separate)
    • Tx details
  • Settings
    • Load required confirmations
    • Load owner list
    • Load current master copy (implies contract version)
    • Load module list
  • Other
    • Images
    • (Technical) Register device for pushes?

When is data reloaded?

  • App start
    • Just the balances (Since the app startes on the Assets -> Coins screen.
  • App comes from background to foreground
    • Reload whatever screen was open
  • Received push notification
    • tbd
  • Manual refresh by user
    • Reload whatever was refreshed
  • User switches Safe
  • [future] User made a transaction

Only reload data per screen

Manual refresh is possible via pull to refresh

  • Where?
    • Assets
    • Tx list
    • Tx details
    • Settings list (Refreshes Safe details)
  • Manual refresh cancels other reloads that might be pending for the same resource
  • There should be visual feedback when refreshed via pull to refresh (e.g. loading spinner)

How do we display errors?

Text input

If there is a text input - then errors are in the error label on/near the text input fields.

In lists / in settings

  • Error during initial loading -> "No data" screen + timed snackbar message
  • Error during pull to refresh -> same data stays, + timed snackbar message
  • Error during other network request -> keep screen state + timed snackbar message
  • "no internet connection" counts as error - It is show upon the "data reload event" or upon "user action", i.e. not upon "network availability" events

App does not “remember”, i.e. data is always loaded ad-hoc when needed.

  • Always only reload data when accessing a specific screen
  • Don’t persist data as in previous section, i.e. when app is started and there is no Internet connection, then there will be no data displayed inside the app

Misc

We used the following 2 working docs during the discussion:

There was another discussion during backlog refinement

Clone this wiki locally